Skip Navigation

FrontDoor CDN with WAF, Domains and Logs to EventHub

Last updated: 07-07-2022

This template creates a new Azure FrontDoor cdn profile. Create WAF with custom and managed rules, cdn routes, origin and groups with their association with WAF and routes, configures custom domains, create event hub and diagnostic settings for sending CDN access logs using event hub.

This Azure Resource Manager (ARM) template was created by a member of the community and not by Microsoft. Each ARM template is licensed to you under a licence agreement by its owner, not Microsoft. Microsoft is not responsible for ARM templates provided and licensed by community members and does not screen for security, compatibility or performance. Community ARM templates are not supported under any Microsoft support programme or service and are made available AS IS without warranty of any kind.


Parameter Name Description
skuName Name of Azure CDN SKU
envName Environment Name
cdnProfileName Name of CDN Profile
afdEndpointName AFD Endpoint Name
origins Origin details
customDomains Custom Domain Array
cdnProfileTags Tags to identify resource owner
enableAfdEndpoint AFD Endpoint State
eventHubName Event Hub Name
eventHubNamespace Event Hub Namespace Name
eventHubLocation Event Hub Namespace location
wafPolicyName Name of the WAF policy to create.
wafPolicyMode Describes if it is in detection mode or prevention mode at policy level.
enableWAFPolicy Describes if the policy needs to enabled or disabled.
wafBlockResponseBody Response body to return on Block
wafBlockResponseCode Response Code to return on Block. Default to 403
enableRequestBodyCheck Describes if request body should be checked. Since we only allow GET in this module due to Custom Rule, default to false

Use the template


New-AzResourceGroup -Name <resource-group-name> -Location <resource-group-location> #use this command when you need to create a new resource group for your deployment
New-AzResourceGroupDeployment -ResourceGroupName <resource-group-name> -TemplateUri
Install and configure Azure PowerShell

Command line

az group create --name <resource-group-name> --location <resource-group-location> #use this command when you need to create a new resource group for your deployment
az group deployment create --resource-group <my-resource-group> --template-uri
Install and Configure the Azure Cross-Platform Command-Line Interface