4

I am following these instructions on how to configure a custom domain for a blob storage endpoint

and get to the instruction on configuring the custom domain name

Azure shows

this screen

I expect I need to enter the custom domain name but I am not clear on how to do this.

For example which one?

contoso.com
www.contoso.com
http://www.contoso.com
http://contoso.com 

I am trying contoso.com

When I do this I see a brief message stating

Failed to update storage account 'mystaticwebsite' Error: The custom domain name could not be verified. CName mapping from contoso.com to mywebsite.blob.core.windows.net does not exist
  • using my example names

I have only just changed my domain name hosting location so I expect I need to wait.

[Update] I see that all my storage accounts belong to the same Active Directory. Could it be that the website needs to have the same domain as the Azure Active Directory?

[Update] I see the CName record is not propagating. I have asked about it here

3 Answers 3

23

I noticed existing answers are over a year old. Here is my scenario and the simple change I needed:

  1. I already had my domain/website running through Cloudflare for the past 5+ years. My simple static .html website was being hosted on a traditional IIS server, but Azure's Static website offering is much more attractive, so now I was trying to move everything over as an Azure static website.
  2. I created a new Storage Account and set up the "Static website" and copied my files over via Azure Storage Explorer.
  3. My static website was working over Azure's url -- https xxxxxx.z5.web.core.windows.net fine.
  4. I went to the "Custom domain" settings in the Blob service section of my Storage Account and followed the instructions of adding a CNAME for example.com and www in Cloudflare's DNS settings dashboard.
  5. Back in the Azure Portal, I typed www.example.com into the custom domain textbox, but was immediately notified of:

    "Failed to update storage account 'xxxxxxx'. Error: The custom domain name could not be verified. CNAME mapping from www.example.com to any of xxxxx.windows.net, xxxxx.core.windows does not exist."

  6. But I already followed the CNAME instructions and my Cloudflare DNS entries looked exactly like they wanted. I waited hours, thinking it was a DNS replication/refresh issue. I went to bed. Same problem in the morning.

  7. THEN I noticed one thing that was different in Cloudflare... All 3 of the CNAMES i set up (asverify.www, example.com and www) all had Status "DNS and HTTP proxy (CDN)" turned on (the cloud icon with an arrow through it was lit up and orange colored.)
  8. I clicked each one to turn off HTTP proxy. So now my DNS entries at Cloudflare are "DNS only" <-- this is the tl;dr, thanks for reading all this way.

tl;dr: If your DNS Records are set up in Cloudflare, you must make each of those entries "DNS only" and not "DNS and HTTP proxy (CDN)"

Edit: After your custom domain name is verified, you can go back into Cloudflare and turn the HTTP proxy (CDN) back on. You will need to add a Page Rule of example.com/* to Forwarding URL 301 to https://www.example.com/$1 if you want SSL to work for a root site.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I look forward to checking this out. I have heard that there are newer improvements https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website and https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-custom-domain
I did exactly like this but still had no luck. Turns out I had to add the CNAME-rules to my domain name registrar (hope that's the correct term) as well as to Cloudflare, even though I am already using Cloudflare's nameservers and everything seemed to be working just fine when came to the DNS pointing at my Azure Static Website. I guess Azure goes to the domain name registrar to verify the CNAME-rule and not to however happens to be in control of the nameservers actually being used. I hope it all make sense!
During and after the process of adding a custom domain, did the xxxxxx.z5.web.core.windows.net address continue to work or does that get removed?
2

As your first link mentioned, you need to get a custom domain name which binds your blob storage endpoint url before you enter the domain name in textbox.( step 3, 4, 5 ). If you enter the domain name casually, you would get the above error. And you needn’t to enter ‘http://’ in textbox. The ‘contoso.com’ and ‘www.contoso,com’ are OK.

If you have a custom domain name, you just need to create a CNAME record with your DNS provider that points from your domain (like www.contoso.com) to blob endpoint url. Different domain registrar's websites have different methods.

For Azure,you could follow my steps to bind a domain name to blob endpoint url:

  1. Before you do this, please make sure you have purchased a valid domain name. If not, please refer to this step to buy: (App Service>Create App service>click Custom domains> Buy domain). Or you could read this article to buy a domain name. Buy domain
    If you have already purchased it, you could see the custom domain name like this: the domain name you have purchased

  2. Open your App Service>Custom domains>App Service Domains(domain name list)> click your domain name>Click DNS Zone>click ‘+Record set’ button. Record set

  3. In Name property, you could enter a custom domain name( such as aa.contoso.com). In Type, you could choose CNAME. In Alias, you could enter your blob storage endpoint url which you want to bind( such as myname.blob.core.windows.net). After you saved the record, you’d better to click ‘Refresh’ button to refresh the domain record list. The bind screenshot like this: Bind blob endpoint url to custom domain name
  4. Return storage account> Blob Service>Custom domain>In textbox, you could enter the custom domain name which you have created. (such as aa.contoso.com).
  5. Finally, you could save the domain name successfully. (If you saved successfully, the ‘Save’ button would be disabled.) save custom domain name successfully

7 Comments

Thanks Janley, however I am not using an App Service. I am using a storage blob.
I know. But before you enter the custom domain name in textbox, you need to ensure this domain name has been bound to your blob endpoint url. (my step 3). If you enter an invalid domain name in textbox, you would get error as you mentioned. In Azure, if you want to point domain name to your blob endpoint url, you could bind domain name to this url first, then you could save it successfully in storage account>blob service>custom domain>textbox>enter the domain name you have bound to url.
Your requirement is step 4. Before you operate step 4, you need to do some operators in App Service to bind your domain name to blob endpoint url(step 3). If you enter a domain name directly, you would get error as you mentioned above.
I should have mentioned my DNS is not hosted at Azure. I set up the CName for www to be the blob name. I am waiting for it to propagate.
If your DNS is not hosted at Azure, you could go to your domain registrar's websites to create a CNAME record to point a domain name to blob endpoint url. Then you could copy this valid domain name to textbox in Blob Service>Custom domain.
|
2

I made a CNAME record with name=docs Alias to myblob.website.blob.core.windows.net ( i.e mapping to the storage account in Azure)

Then in the text box in the Azure Custom domain screen I entered docs.contoso.com

then I made a redirect for www to http://docs.contoso.com/index.html So now www.contoso.com opens the index.html to say "hello world"

Note I do have the $root container set up with index.html inside it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.