This is a Minimal ASP.NET (7.0.0.0) Web Application that:
- Exposes health checks via the /healthz (via Microsoft.Extensions.Diagnostics.HealthChecks)
- Redirects all other requests to a catch-all Razor Page that outputs the http connection, header and query properties.
- All headers that start with X-AZURE or X-FORWARDED are logged to App Insights.
You can use this application when testing different hosting configurations.
Try the following urls:
- https://minimal-web-razor.azurewebsites.net
- https://minimal-web-razor.azurewebsites.net/healthz
- https://minimal-web-razor.azurewebsites.net/path/to/non/existant/folder/handled/by/catch-all
- https://minimal-web-razor.azurewebsites.net/test-query-string?key1=value1&key2=value2
git clone https://github.com/rohit-lakhanpal/minimal-web-razor.git
cd minimal-web-razor/src
dotnet build Minimal.Web.sln
> dotnet run Minimal.Web.sln --project Minimal.Web.Razor
After navigating to the url (based on dotnet run Minimal.Web.sln --project Minimal.Web.Razor
) this is what you can expect.
This minimal application is based on the minimal-web project and has been adapted for Razor Pages.
I have additionally added the following packages:
- Microsoft.Extensions.Diagnostics.HealthChecks
- Microsoft.ApplicationInsights.AspNetCore