Azure / Azure/azure-quickstart-templates
Template for CDN Endpoint with Custom Domain
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[cdn-with-custom-domains]() - not available yet
### Issue Details
Do you guys have ARM template example for CDN Profile with CDN endpoint that has custom domain?
We follow the doc laid out here: [Microsoft.Cdn profiles/endpoints/customDomains template reference](https://docs.microsoft.com/en-us/azure/templates/microsoft.cdn/2019-04-15/profiles/endpoints/customdomains), but got `400 Client Error: Bad Request` error message.
### Template
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {
"profileName": "test-profile",
"endpointName": "test-endpoint",
"skuName": "Standard_Microsoft"
},
"resources": [
{
"name": "[variables('profileName')]",
"type": "Microsoft.Cdn/profiles",
"location": "northcentralus",
"apiVersion": "2019-04-15",
"sku": {
"name": "[variables('skuName')]"
},
"resources": [
{
"apiVersion": "2019-04-15",
"dependsOn": [
"[resourceId('Microsoft.Cdn/profiles', variables('profileName'))]"
],
"location": "northcentralus",
"name": "[variables('endpointName')]",
"type": "endpoints",
"properties": {
"originHostHeader": "astorageaccount.a33.web.core.windows.net",
"isHttpAllowed": true,
"isHttpsAllowed": true,
"queryStringCachingBehavior": "IgnoreQueryString",
"contentTypesToCompress": [
"text/plain",
"text/html"
],
"isCompressionEnabled": true,
"origins": [
{
"name": "origin",
"properties": {
"hostName": "astorageaccount.a33.web.core.windows.net"
}
}
]
},
"resources":[
{
"apiVersion": "2019-04-15",
"name": "Custom Domain",
"type": "customDomains",
"properties": {
"hostName": "custom.domain.com"
}
}
]
}
]
}
],
"outputs": {
}
}
```
### Error
```
400 Client Error: Bad Request for url: https://management.azure.com/subscriptions//resourcegroups/test-profile/providers/Microsoft.Resources/deployments/Deployment?api-version=2018-05-01
```
### Repro steps
1. Save the template in a json file.
2. Run `az` command to deploy the template.
`az group deployment create --name "Deployment" --mode Complete --resource-group such-resource-group --template-file "such-cdn.json"`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the supplied JSON template and the Microsoft.Cdn customDomains template reference, then reproduce the deployment using the shown az group deployment create command. Check how the nested customDomains resource is named and related to the endpoint. Done means a documented or added quickstart template deploys successfully with a CDN endpoint and custom domain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, json
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100