Error adding Custom Domain to CDN
See original GitHub issueThe following Farmer program fails to deploy with the following error. I’m not sure what to do about this. If I remove the domain name the problem goes away.
Deploying ARM template (please be patient, this can take a while)...
Unhandled exception. System.Exception: Azure Error: InvalidTemplate
Message: Deployment template validation failed: 'The template resource 'my-7e453-cdn-endpoint/my-7e453-cdn-endpointdomain' for type 'Microsoft.Cdn/profiles/endpoints/customDomains' at line '69' and column '62' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.
let storageAcc = storageAccount {
name "my7e453storage"
sku Storage.Sku.Standard_LRS
use_static_website "/path/to/content" "index.html"
}
let cdnProfile = cdn {
name ("my7e453-cdn")
add_endpoints [
(endpoint {
name ("my-7e453-cdn-endpoint")
origin (storageAcc.WebsitePrimaryEndpoint |> System.Uri).Host
optimise_for Cdn.OptimizationType.GeneralWebDelivery
enable_https
disable_http
custom_domain_name "https://sub.example.com"
})
]
}
// Generate the ARM template
arm {
location Location.UKSouth
add_resource storageAcc
add_resource cdnProfile
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Cannot map custom domain to CDN endpoint
I have a DNS Zone and have added a CNAME record that maps to my Azure CDN Endpoint resource. It created the verify...
Read more >Unable to map custom domain name to CDN endpoint
Hi there, I created a DNS zone for a subdomain comms.XXXXXX.com and added those NS records to the root domain I have in...
Read more >Adding custom domain to second CDN endpoint fails #30112
After I have added "cdndemo101.dustydogpetcare.online" to the first endpoint and go to add it to the second I get the following error:
Read more >Unable to access CDN endpoint via custom subdomain
When I skip the cdnverify step, e.g. assign the azureedge CNAME value directly to a host called “v2”, and add that as a...
Read more >Error enabling custom https on CDN custom domain
This occurs via the CLI ( az cdn custom-domain enable-https ) and through the web portal. We have digicert set up as an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry it took me so long to respond. The stated change is much nicer. Thank you
BTW if in the short term you want to fix the ARM templates generated, it’s just going to be the Custom Domain name in the template - you’ll need to prefix the path with the profile name e.g. in the example above, “my7e453-cdn/”