Microsoft Azure
Published in

Microsoft Azure

How to do health checks for Azure functions and Web Apps.

With Azure Monitor and IaaS via C#.

This article is a part of the https://www.azurespringclean.com/ #AzureFamily community event.

Azure Monitor health checks with infrastructure.

Short introduction — Pulumi for developers
  1. Install Pulumi from https://www.pulumi.com/docs/get-started/install/
  2. Run in the CMD az login command to get an auth token for a subscription.
  3. Run pulumi login (you will be prompted to register a new account)
  4. Run pulumi new azure-csharp to create the new C# app for your infrastructure.
  5. You can open this project both in VS Code or Visual Studio 2019, I prefer the latter for better IntelliSense support :).
Pulumi project structure.
Basic infrastructure code via C#
Preview of resources that will be deployed.
Deployment results.
Azure availability Alert.
Internal exception during deployment
Mention of exact error during infrastructure deployment.
Successful update of Alert configuration.

Azure Functions host health monitor.

{
"healthMonitor": {
"enabled": true,
"healthCheckInterval": "00:05:00",
"healthCheckWindow": "00:10:00",
"healthCheckThreshold": 6,
"counterThreshold": 0.80
}
}
Microsoft.Extensions.Diagnostics.HealthChecks
Microsoft.Extensions.Diagnostics.HealthChecks

Azure Web Apps health monitoring.

Sample of basic health check configuration.
Sample with an underlying service error.

The summary.

--

--

Any language. Any platform. Our team is focused on making the world more amazing for developers and IT operations communities with the best that Microsoft Azure can provide. If you want to contribute in this journey with us, contact us at medium@microsoft.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stas(Stanislav) Lebedenko

Azure MVP | MCT | Software/Cloud Architect | Dev | https://github.com/staslebedenko | Odesa MS .NET/Azure group | Serverless fan 🙃| IT2School/AtomSpace