I want to tell the Azure CDN that my origin is at a specific path, e.g. mydomain.com/cdn
. This option is available through the Azure Portal (CDN Profile > Endpoint > Configure > Origin path)
I'm deploying my Azure resources using Resource Manager APIs and Json templates. However, I can't find this setting in the template here: https://github.com/Azure/azure-quickstart-templates/tree/master/201-cdn-customize
Is this not available or am I missing something?
Update
Using the Resource Explorer, I found the property on the endpoints node with a null
. Even if I try to set the value (and the API accepts it), the value is not set.
{
"value": [
{
"name": "<hidden>",
"id": "/subscriptions/<hidden>/resourcegroups/<hidden>/providers/Microsoft.Cdn/profiles/<hidden>/endpoints/<hidden>",
"type": "Microsoft.Cdn/profiles/endpoints",
"tags": {},
"location": "NorthEurope",
"properties": {
"hostName": "<hidden>",
"originHostHeader": "<hidden>",
"provisioningState": "Succeeded",
"resourceState": "Running",
"isHttpAllowed": true,
"isHttpsAllowed": true,
"queryStringCachingBehavior": "UseQueryString",
"originPath": null,
"origins": [
{
"name": "<hidden>",
"properties": {
"hostName": "<hidden>",
"httpPort": null,
"httpsPort": null
}
}
],
"contentTypesToCompress": [
"application/x-javascript",
"text/css",
"text/html",
"text/javascript",
"text/plain"
],
"isCompressionEnabled": false
}
}
]
}
Edited 4/15/2016 to correct the code insert
Since that is an optional configuration, the template may not have it. The portion from azuredeploy.json line 97, appears to be configuring CDN endpoint. Adding the line 104 as below should help.
97 "properties": {
98 "originHostHeader": "[parameters('originUrl')]",
99 "isHttpAllowed": "[parameters('isHttpAllowed')]",
100 "isHttpsAllowed": "[parameters('isHttpsAllowed')]",
101 "queryStringCachingBehavior": "[parameters('queryStringCachingBehavior')]",
102 "contentTypesToCompress": "[parameters('contentTypesToCompress')]",
103 "isCompressionEnabled": "[parameters('isCompressionEnabled')]",
104 "originPath": "[parameters('originPath')]",
105 "origins": [
106 {
107 "name": "origin1",
108 "properties": {
109 "hostName": "[parameters('originUrl')]"
110
111 }
112 }
113 ]
Of course you will need to add this block in your parameter file
"originPath": {
"value": "/cdn"
}
Hopefully this would work out for you