The file that we are linking to in blob storage is not updating when using a custom domain, but does update if we do not use the custom domain

William Pedrick 20 Reputation points
2025-04-16T10:38:05.1866667+00:00

Example below:

  1. A PDF file is generated using our application and uploaded to the Blob Storage account.
  2. The Blob Storage file (PDF) is accessed using a custom domain, instead of the standard blob.core.windows.net prefix.
  3. We update the PDF using our application. This is then uploaded to the Blob Storage account.
  4. If we try to access the Blob Storage file (PDF) using the custom domain, the file is still showing the old version of the PDF file.
  5. If we access the Blob Storage file (PDF) using the blob.core.windows.net prefix domain, the file is correctly showing the new version of the PDF file.

Why is it not showing the correct version on the custom domain? Is there a CDN settings that we need to configure?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,143 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 118.5K Reputation points
    2025-04-16T11:28:18.2866667+00:00

    Hi William,

    It sounds like you are using Azure Front Door/CDN in front of your storage account so that you can use custom domain, and caching is enabled. What you can do is disable caching on route(s), and then purge the cache.

    Below instructions are for Azure Front Door. If you are using classic CDN please let me know or you may be able to figure it out by navigating screens a bit.

    Please navigate to your storage account -- Security + networking -- Front Door and CDN. Give it several seconds for endpoint(s) to show up. Click on host name of endpoint, next click on the route name on left, scroll down to bottom, uncheck Enable caching, then click Update button.

    If you have multiple endpoints with dynamic files repeat above process to disable caching on those.

    To purge cache, please navigate to below link to see list of your Front Door profiles:

    https://portal.azure.com/#browse/microsoft.cdn%2Fprofiles

    Click on the one for your storage account, next click on Purge cache button at top. Select the endpoint from dropdown, select Domain(s), check Purge all assets for the selected domains and click Purge button. Wait 15 minutes for the files to be purged and then test.

    Cache purging in Azure Front Door

    https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/how-to-cache-purge

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Hari Babu Vattepally 2,715 Reputation points Microsoft External Staff
    2025-04-16T11:33:10.5666667+00:00

    Hi @William Pedrick ,

    The issue which you are facing with the custom domain, which is not showing the updated PDF file, which the issue is likely related to the caching settings. When accessing your Blob Storage file via a custom domain, especially with Azure CDN, the content might be cached on the CDN edge servers. As a result, even after uploading a new PDF version, the CDN could still serve the old version until the cache is cleared.

    To fix this issue, please clear the cached content on the CDN edge servers by purging the CDN endpoint. This will ensure the latest version of your PDF file is served when accessed through the custom domain.

    Also, use tools like curl or browser developer tools to inspect the HTTP headers when accessing the file via the custom domain. Look for caching-related headers like Cache-Control and ETag.

    However, please temporarily disable Azure CDN for your custom domain to determine if the issue is related to caching. If the file updates correctly without the CDN, then the problem is indeed with the caching settings.

    Also, please consider enabling blob versioning in your storage account. This will ensure that each update creates a new version of the file and can help prevent caching conflicts.

    For more information, please follow the below document:

    I hope the above helps in addressing your query.

    Please let us know in the comments below, if the issue is resolved or still persists. We will be glad to assist you closely.

    Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members. Accepted answers show up at the top, resulting in improved discoverability for others.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.