2
votes

I'm having an issue where blobs accessed via a new CDN endpoint are returning 404.

  1. I created a Storage Container V2 (not classic).
  2. I set the Storage Container Access Policy to Public Blobs.
  3. I created an Azure CDN and Endpoints (via CDN Profiles).
  4. I mapped the CDN to my Storage Container.

I've read in the documentation that it can take up to 90 minutes for the CDN to be available. However, I've waited over 4 hours and the blobs are still unavailable.

The only response I receive is 404 Not Found. I have confirmed that the blobs are accessible when hitting the public Storage Container endpoint (not via the CDN).

Not really sure what to do now.

3

3 Answers

0
votes

Please make sure that the origin you provided to create cdn endpoint is publicly available (by putting the url in the browser and try to visit), ff still doesn't work, you can submit a support ticket.

0
votes

I had to wait 24 hours for the CDN to be available.

0
votes

I had this concern when hosting a static website on Azure Blob Storage using Powershell scripts.

My command was this:

# Define Variables
$RESOURCE_GROUP_NAME = 'myresourcegroup'
$LOCATION = 'northeurope'
$STORAGE_ACCOUNT_NAME = 'mystorageaccount'
$WEBSITE_URL = mywebsite.z16.web.core.windows.net

New-AzCdnEndpoint -ProfileName $STORAGE_ACCOUNT_NAME -ResourceGroupName $RESOURCE_GROUP_NAME -Location $LOCATION -EndpointName $STORAGE_ACCOUNT_NAME -OriginName $STORAGE_ACCOUNT_NAME -OriginHostName $WEBSITE_URL

I ran into the error each time I tried accessing the website using the Azure CDN URL:

The requested URI does not represent any resource on the server
HttpStatusCode: 400

Here's how I fixed it:

I was missing out on the OriginHostHeader parameter. So I had to add it this time.

# Define Variables
$RESOURCE_GROUP_NAME = 'myresourcegroup'
$LOCATION = 'northeurope'
$STORAGE_ACCOUNT_NAME = 'mystorageaccount'
$WEBSITE_URL = mywebsite.z16.web.core.windows.net

New-AzCdnEndpoint -ProfileName $STORAGE_ACCOUNT_NAME -ResourceGroupName $RESOURCE_GROUP_NAME -Location $LOCATION -EndpointName $STORAGE_ACCOUNT_NAME -OriginName $STORAGE_ACCOUNT_NAME -OriginHostName $WEBSITE_URL -OriginHostHeader $WEBSITE_URL

Note:

The OriginHostName and the OriginHostHeader should be of the same value which is the URL of the Azure Storage Container where the website is hosted. In this case it is mywebsite.z16.web.core.windows.net, and not https://mywebsite.z16.web.core.windows.net/

That's all.

I hope this helps