Web apps use health probes#
Reliability · App Service · Rule · 2022_06
Configure and enable instance health probes.
Description#
Azure App Service monitors a specific path for each web app instance to determine health status. The monitored path should implement functional checks to determine if the app is performing correctly. The checks should include dependencies including those that may not be regularly called.
Regular checks of the monitored path allow Azure App Service to route traffic based on availability.
Recommendation#
Consider configuring a health probe to monitor instance availability.
Examples#
Configure with Azure template#
To deploy Web Apps that pass this rule:
- Set
properties.siteConfig.healthCheckPath
to a valid application path such as/healthz
.
For example:
Azure Template snippet
{
"type": "Microsoft.Web/sites",
"apiVersion": "2021-03-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"identity": {
"type": "SystemAssigned"
},
"kind": "web",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('planName'))]",
"httpsOnly": true,
"siteConfig": {
"alwaysOn": true,
"minTlsVersion": "1.2",
"ftpsState": "FtpsOnly",
"remoteDebuggingEnabled": false,
"http20Enabled": true,
"netFrameworkVersion": "v6.0",
"healthCheckPath": "/healthz"
}
},
"tags": "[parameters('tags')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('planName'))]"
]
}
Configure with Bicep#
To deploy Web Apps that pass this rule:
- Set
properties.siteConfig.healthCheckPath
to a valid application path such as/healthz
.
For example:
Azure Bicep snippet
resource webApp 'Microsoft.Web/sites@2021-03-01' = {
name: name
location: location
identity: {
type: 'SystemAssigned'
}
kind: 'web'
properties: {
serverFarmId: plan.id
httpsOnly: true
siteConfig: {
alwaysOn: true
minTlsVersion: '1.2'
ftpsState: 'FtpsOnly'
remoteDebuggingEnabled: false
http20Enabled: true
netFrameworkVersion: 'v6.0'
healthCheckPath: '/healthz'
}
}
tags: tags
}
Links#
- Creating good health probes
- Route traffic to healthy instances (App Service)
- Health Check is now Generally Available
- Azure deployment reference
Last update:
2022-11-27