Skip to content

A Minimal ASP.NET (7.0.0.0) Web Application that exposes health checks and outputs the http connection, header and query string properties.

License

Notifications You must be signed in to change notification settings

rohit-lakhanpal/minimal-web-razor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Minimal Web Application (Razor Pages)

Overview

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.

Build and deploy ASP.Net Core app to Azure Web App - minimal-web-razor

Demo

Try the following urls:

How to run this sample

Clone the repo

git clone https://github.com/rohit-lakhanpal/minimal-web-razor.git

Build the solution

cd minimal-web-razor/src

dotnet build Minimal.Web.sln

Run the project

> dotnet run Minimal.Web.sln --project Minimal.Web.Razor

Run Output

Expected output

After navigating to the url (based on dotnet run Minimal.Web.sln --project Minimal.Web.Razor) this is what you can expect.

Preview

About the code

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

About

A Minimal ASP.NET (7.0.0.0) Web Application that exposes health checks and outputs the http connection, header and query string properties.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published