Use HEAD health probes for Front Door backends#
Reliability · Front Door · Rule · 2021_03 · Important
Configure health probes to use HEAD
requests to reduce performance overhead.
Description#
Azure Front Door supports sending HEAD
or GET
requests for health probes to backend endpoints.
HTTP HEAD
requests are identical to GET
requests except that the server does not send a response body.
As a result, HEAD
request typically have a lower performance impact then GET
request.
By eliminating a response body:
- The server has a smaller payload to return.
- May be able to further optimize the request by reducing calls to APIs or databases.
Recommendation#
Consider configuring health probes to query backend health endpoints using HEAD
requests to reduce performance overhead.
Examples#
Configure with Azure template#
To deploy a Front Door resource that passes this rule:
- Set the
properties.healthProbeSettings.probeRequestType
property toHEAD
of theoriginGroups
sub-resource.
For example:
{
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2021-06-01",
"name": "[parameters('name')]",
"location": "Global",
"sku": {
"name": "Premium_AzureFrontDoor"
}
},
{
"type": "Microsoft.Cdn/profiles/originGroups",
"apiVersion": "2021-06-01",
"name": "[format('{0}/{1}', parameters('name'), parameters('name'))]",
"properties": {
"loadBalancingSettings": {
"sampleSize": 4,
"successfulSamplesRequired": 3
},
"healthProbeSettings": {
"probePath": "/healthz",
"probeRequestType": "HEAD",
"probeProtocol": "Http",
"probeIntervalInSeconds": 100
}
},
"dependsOn": [
"[parameters('name')]"
]
}
To deploy a Front Door resource that passes this rule:
- Set each
properties.healthProbeSettings[*].properties.healthProbeMethod
property toHEAD
.
For example:
{
"type": "Microsoft.Network/frontDoors",
"apiVersion": "2021-06-01",
"name": "[parameters('name')]",
"location": "global",
"properties": {
"enabledState": "Enabled",
"frontendEndpoints": "[variables('frontendEndpoints')]",
"loadBalancingSettings": "[variables('loadBalancingSettings')]",
"backendPools": "[variables('backendPools')]",
"healthProbeSettings": [
{
"name": "[variables('healthProbeSettingsName')]",
"properties": {
"enabledState": "Enabled",
"path": "/healthz",
"protocol": "Http",
"intervalInSeconds": 120,
"healthProbeMethod": "HEAD"
}
}
],
"routingRules": "[variables('routingRules')]"
}
}
Configure with Bicep#
To deploy a Front Door resource that passes this rule:
- Set the
properties.healthProbeSettings.probeRequestType
property toHEAD
of theoriginGroups
sub-resource.
For example:
resource afd_premium 'Microsoft.Cdn/profiles@2021-06-01' = {
name: name
location: 'Global'
sku: {
name: 'Premium_AzureFrontDoor'
}
}
resource frontDoorOriginGroup 'Microsoft.Cdn/profiles/originGroups@2021-06-01' = {
name: name
parent: afd_premium
properties: {
loadBalancingSettings: {
sampleSize: 4
successfulSamplesRequired: 3
}
healthProbeSettings: {
probePath: '/healthz'
probeRequestType: 'HEAD'
probeProtocol: 'Http'
probeIntervalInSeconds: 100
}
}
}
To deploy a Front Door resource that passes this rule:
- Set each
properties.healthProbeSettings[*].properties.healthProbeMethod
property toHEAD
.
For example:
resource afd_classic 'Microsoft.Network/frontDoors@2021-06-01' = {
name: name
location: 'global'
properties: {
enabledState: 'Enabled'
frontendEndpoints: frontendEndpoints
loadBalancingSettings: loadBalancingSettings
backendPools: backendPools
healthProbeSettings: [
{
name: healthProbeSettingsName
properties: {
enabledState: 'Enabled'
path: '/healthz'
protocol: 'Http'
intervalInSeconds: 120
healthProbeMethod: 'HEAD'
}
}
]
routingRules: routingRules
}
}
Configure with Azure CLI#
az network front-door probe update --front-door-name '<front_door>' -n '<probe_name>' -g '<resource_group>' --probeMethod 'HEAD' --path '/healthz'
Configure with Azure PowerShell#
$probeSetting = New-AzFrontDoorHealthProbeSettingObject -Name '<probe_name>' -HealthProbeMethod 'HEAD' -Path '/healthz'
Set-AzFrontDoor -Name '<front_door>' -ResourceGroupName '<resource_group>' -HealthProbeSetting $probeSetting
Links#
- Creating good health probes
- Health probes
- Supported HTTP methods for health probes
- How Front Door determines backend health
- Health Endpoint Monitoring pattern
- Azure deployment reference (Premium / Standard)
- Azure deployment reference (Classic)