Remove extension from blob objects

Romain M 1 Reputation point
2021-08-15T11:40:17.07+00:00

Hi,

I have files named [number].json in my blob storage. I would like those files to be accessible without the extension in the URL.
For example, today a file can be accessed with the URL: https:/customDomainName/BlobStorageName/4.json
I would this same file to be accessible (only) using the URL: https:/customDomainName/BlobStorageName/4

I've tried using the CDN rules engine but didn't understand how it works.

Thank you for your help.
Best,
Romain

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,472 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,316 Reputation points
    2021-08-16T07:06:03.56+00:00

    @Romain M Thank you for the additional context.
    You should be able to set up URL rewrite on the CDN to route requests to BlobStorageName to automatically append a .json extension.

    I have a created a sample regex here. Please test it, modify according to your use case and use it to configure the URL rewrite.

    123493-image.png

    The URL https://customDomainName/BlobStorageName/4 should rewrite the path to https://customDomainName/BlobStorageName/4.json

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.
    And if you have further questions or issues, please let us know.

    0 comments No comments