Skip to content

Use a Dedicated Health Endpoint for Front Door backends#

Reliability · Front Door · 2021_03

Configure a dedicated path for health probe requests.

Description#

Azure Front Door monitors a specific path for each backend to determine health status. The monitored path should implement functional checks to determine if the backend is performing correctly. The checks should include dependencies including those that may not be regularly called.

Regular checks of the monitored path allow Front Door to make load balancing decisions based on status.

Recommendation#

Consider using a dedicated health probe endpoint that implements functional checks.

Examples#

Configure with Azure CLI#

Azure CLI snippet
az network front-door probe update --front-door-name '<front_door>' -n '<probe_name>' -g '<resource_group>' --path '<path>'

Configure with Azure PowerShell#

Azure PowerShell snippet
$probeSetting = New-AzFrontDoorHealthProbeSettingObject -Name '<probe_name>' -Path '<path>'
Set-AzFrontDoor -Name '<front_door>' -ResourceGroupName '<resource_group>' -HealthProbeSetting $probeSetting

Configure with Azure template#

To deploy a Front Door resource that passes this rule:

  • Configure the healthProbeSettings.probePath on the OriginGroup

For example:

Azure Template snippet
  "resources": [
    {
      "type": "Microsoft.Cdn/profiles",
      "apiVersion": "2021-06-01",
      "name": "[parameters('frontDoorName')]",
      "location": "Global",
      "sku": {
        "name": "Standard_AzureFrontDoor"
      }
    },
    {
      "type": "Microsoft.Cdn/profiles/afdEndpoints",
      "apiVersion": "2021-06-01",
      "name": "[format('{0}/{1}', parameters('frontDoorName'), variables('frontDoorEndpointName'))]",
      "location": "Global",
      "properties": {
        "enabledState": "Enabled"
      },
      "dependsOn": [
        "[resourceId('Microsoft.Cdn/profiles', parameters('frontDoorName'))]"
      ]
    },
    {
      "type": "Microsoft.Cdn/profiles/originGroups",
      "apiVersion": "2021-06-01",
      "name": "[format('{0}/{1}', parameters('frontDoorName'), variables('frontDoorDefaultOriginGroupName'))]",
      "properties": {
        "loadBalancingSettings": {
          "sampleSize": 4,
          "successfulSamplesRequired": 3
        },
        "healthProbeSettings": {
          "probePath": "/",
          "probeRequestType": "HEAD",
          "probeProtocol": "Http",
          "probeIntervalInSeconds": 100
        }
      },
      "dependsOn": [
        "[resourceId('Microsoft.Cdn/profiles', parameters('frontDoorName'))]"
      ]
    }
  ]
  ```

### Configure with Bicep

To deploy a Front Door resource that passes this rule:

- Configure the healthProbeSettings.probePath on the OriginGroup

For example:

```bicep title="Azure Bicep snippet"
resource frontDoorResource 'Microsoft.Cdn/profiles@2021-06-01' = {
  name: frontDoorName
  location: 'Global'
  sku: {
    name: 'Standard_AzureFrontDoor'
  }
}

resource frontDoorEndpoint 'Microsoft.Cdn/profiles/afdendpoints@2021-06-01' = {
  parent: frontDoorResource
  name: frontDoorEndpointName
  location: 'Global'
  properties: {
    enabledState: 'Enabled' 
  }
}

resource frontDoorOriginGroup 'Microsoft.Cdn/profiles/origingroups@2021-06-01' = {
  name: frontDoorDefaultOriginGroupName
  parent: frontDoorResource
  properties: {
    loadBalancingSettings: {
      sampleSize: 4
      successfulSamplesRequired: 3
    }
    healthProbeSettings: {
      probePath: '/'
      probeRequestType: 'HEAD'
      probeProtocol: 'Http'
      probeIntervalInSeconds: 100
    }
  }
}

Last update: 2022-10-17

Comments