Skip to content

Instantly share code, notes, and snippets.

@cdennig

cdennig/storage_cdn.json

Last active Aug 18, 2017
Embed
What would you like to do?
Azure Storage Account plus CDN
{
"name": "[variables('storageName')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2016-01-01",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "BlobStorage",
"dependsOn": [],
"tags": {
"displayName": "Storage Blobs / CDN backend"
},
"properties": {
"accessTier": "Hot"
}
},
{
"name": "[variables('profileName')]",
"type": "Microsoft.Cdn/profiles",
"location": "[resourceGroup().location]",
"apiVersion": "2016-04-02",
"tags": {
"displayName": "CDN"
},
"sku": {
"name": "Standard_Akamai"
},
"properties": {},
"resources": [{
"apiVersion": "2016-04-02",
"name": "[variables('endpointName')]",
"type": "endpoints",
"dependsOn": [
"[resourceId('Microsoft.Cdn/profiles/', variables('profileName'))]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageName'))]"
],
"location": "[resourceGroup().location]",
"tags": {
"displayName": "CDN Endpoint"
},
"properties": {
"originHostHeader": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts',variables('storageName')),'2015-06-15').primaryEndpoints.blob,'https://',''),'/','')]",
"isHttpAllowed": true,
"isHttpsAllowed": true,
"queryStringCachingBehavior": "IgnoreQueryString",
"contentTypesToCompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"],
"isCompressionEnabled": true,
"origins": [{
"name": "origin1",
"properties": {
"hostName": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts',variables('storageName')),'2015-06-15').primaryEndpoints.blob,'https://',''),'/','')]"
}
}]
}
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment