1
votes

I have created a static website in Azure, it gave me primary point url like <mystorageaccount>.<somerandomcode>.web.core.windows.net which is working fine from the browser.

Now, I followed below steps to use custom domain but no so successful.

  1. created a CNAME with my DNS Service provider for www.mydomain.com
  2. In Azure, storage accounts, mystorageaccount, Custom Domain, I entered www.mydomain.com but it throws error as

Failed to update storage account 'mystorageaccount'. Error: The custom domain name could not be verified. CNAME mapping from www.mydomain to any of .blob.core.windows.net,..web.core.windows.net does not exist.

What I tried? 1. I tried with mydomain.com instead of www.mydomain.com, it accepted and showed me a message that it takes 30 min to propagate.

After about an hour, when I tried www.mydomain.com in the browser it throws me The request URI is invalid with HttpStatusCode: 400. when I tried mydomain.com, server is unavailable.

  1. in CMD, ping mydomain.com gives me some ip address so in DNS Settings I created A record with displayed IP address. After some time, mydomain.com is working as expected but www.mydomain.com still gives me The request URI is invalid with HttpStatusCode: 400.

Note: 1. This IP address may not be static so creating A record with IP is not correct. 2. I tried to point to a subdomain.mydomain.com and at first attempt itself is working as expected but I want this to use to my mydomain.com and www.mydomain.com

What is the solution to work with www. and without www. to custom domain?

1

1 Answers

3
votes

Please note that configuring a custom domain name for your Azure storage account,

The mapping does only work for subdomains (e.g. www.contoso.com). If you want to have your web endpoint available on the root domain (e.g. contoso.com), then you have to use Azure CDN with custom domains.

With Azure CDN, you can create CNAME or A record pointing to your Azure CDN endpoint. Tutorial: Add a custom domain to your Azure CDN endpoint