Search code examples
azureazure-blob-storagedomain-nameazure-cdn

Custom subdomain name for blob CDN endpoint causes error 400


I'm trying to set up a custom domain name for a blob CDN endpoint, following these instructions, but can't seem to access my content using the subdomain static.mydomain.com. I've created the following record with my registrar:

Subdomain: static

Type: CNAME

TTL: 7200

Data: blobconatinername.blob.core.windows.net.

For example, I can access this file (note https): https://blobcontanername.blob.core.windows.net/somefile.mp3

But trying to access this file

http://static.mydomain.com/somefile.mp3

I get an invalid URI error (an error 400):

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>InvalidUri</Code>
<Message>
The requested URI does not represent any resource on the server. RequestId:c5ec4859-0001-0079-0bf8-961dfa000000 Time:2016-04-15T09:22:32.1317877Z
</Message>
<UriPath>
http://static.mydomain.com/somefile.mp3
</UriPath>
</Error>

Resolution?


Solution

  • Can you access the file via the CDN endpoint, yourcdnendpoint.azureedge.net/path/to/file?

    Shouldn't static.yourdomain.com point to the CDN endpoint, not your blob storage?

    Subdomain: static
    
    Type: CNAME
    
    TTL: 7200
    
    Data: yourcdnendpoint.azureedge.net.
    

    Also, the domain you are using must be verified. The process is described at https://azure.microsoft.com/sv-se/documentation/articles/cdn-map-content-to-custom-domain/