Skip to content

Instantly share code, notes, and snippets.

@davidobrien1985
Last active February 9, 2020 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidobrien1985/491b9531c264f8dc84af43bf7ce31a01 to your computer and use it in GitHub Desktop.
Save davidobrien1985/491b9531c264f8dc84af43bf7ce31a01 to your computer and use it in GitHub Desktop.
ARM template to deploy Azure Front Door and maintenance rules
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"frontDoorName": {
"defaultValue": "davidobrien",
"type": "string"
},
"storageAccountName": {
"defaultValue": "davidobrienmaintenance",
"type": "string"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/frontDoors",
"apiVersion": "2018-08-01",
"name": "[parameters('frontDoorName')]",
"location": "Global",
"properties": {
"resourceState": "Enabled",
"backendPools": [
{
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/BackendPools/webapp')]",
"name": "webapp",
"properties": {
"backends": [
{
"address": "david-obrien.net",
"httpPort": 80,
"httpsPort": 443,
"priority": 1,
"weight": 50,
"backendHostHeader": "david-obrien.net",
"enabledState": "Enabled"
}
],
"healthProbeSettings": {
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/HealthProbeSettings/healthProbeSettings-1581213385586')]"
},
"loadBalancingSettings": {
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/LoadBalancingSettings/loadBalancingSettings-1581213385586')]"
},
"resourceState": "Enabled"
}
},
{
"name": "maintenance",
"properties": {
"backends": [
{
"address": "[concat(parameters('frontDoorName'), 'maintenance.z8.web.core.windows.net')]",
"httpPort": 80,
"httpsPort": 443,
"priority": 1,
"weight": 50,
"backendHostHeader": "[concat(parameters('frontDoorName'), 'maintenance.z8.web.core.windows.net')]",
"enabledState": "Enabled"
}
],
"healthProbeSettings": {
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/HealthProbeSettings/healthProbeSettings-1581216895085')]"
},
"loadBalancingSettings": {
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/LoadBalancingSettings/loadBalancingSettings-1581216895085')]"
},
"resourceState": "Enabled"
}
}
],
"healthProbeSettings": [
{
"name": "healthProbeSettings-1581213385586",
"properties": {
"intervalInSeconds": 30,
"path": "/",
"protocol": "Https",
"resourceState": "Enabled"
}
},
{
"name": "healthProbeSettings-1581216895085",
"properties": {
"intervalInSeconds": 30,
"path": "/",
"protocol": "Https",
"resourceState": "Enabled"
}
}
],
"frontendEndpoints": [
{
"name": "xirus-azurefd-net",
"properties": {
"hostName": "[concat(parameters('frontDoorName'), '.azurefd.net')]",
"sessionAffinityEnabledState": "Disabled",
"sessionAffinityTtlSeconds": 0,
"resourceState": "Enabled"
}
}
],
"loadBalancingSettings": [
{
"name": "loadBalancingSettings-1581213385586",
"properties": {
"additionalLatencyMilliseconds": 0,
"sampleSize": 4,
"successfulSamplesRequired": 2,
"resourceState": "Enabled"
}
},
{
"name": "loadBalancingSettings-1581216895085",
"properties": {
"additionalLatencyMilliseconds": 0,
"sampleSize": 4,
"successfulSamplesRequired": 2,
"resourceState": "Enabled"
}
}
],
"routingRules": [
{
"name": "routingrule0",
"properties": {
"frontendEndpoints": [
{
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/FrontendEndpoints/xirus-azurefd-net')]"
}
],
"acceptedProtocols": [
"Http",
"Https"
],
"patternsToMatch": [
"/*"
],
"forwardingProtocol": "HttpsOnly",
"backendPool": {
"id": "[concat(resourceId('Microsoft.Network/frontdoors', parameters('frontDoorName')), '/BackendPools/maintenance')]"
},
"enabledState": "Enabled",
"resourceState": "Enabled"
}
}
],
"enabledState": "Enabled",
"friendlyName": "[parameters('frontDoorName')]"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('storageAccountName')]",
"location": "australiaeast",
"sku": {
"name": "Standard_RAGRS",
"tier": "Standard"
},
"kind": "StorageV2",
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('storageAccountName'), '/default')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"sku": {
"name": "Standard_RAGRS"
},
"properties": {
"cors": {
"corsRules": []
},
"deleteRetentionPolicy": {
"enabled": false
}
}
},
{
"type": "Microsoft.Storage/storageAccounts/fileServices",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('storageAccountName'), '/default')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"sku": {
"name": "Standard_RAGRS"
},
"properties": {
"cors": {
"corsRules": []
}
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('storageAccountName'), '/default/$web')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('storageAccountName'), 'default')]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"properties": {
"publicAccess": "None"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment