Connect to Azure blob storage on custom domain

Viewed 263

I have problem downloading files from this blob storage on our custom domain with HTTPS. I can download it through the browser if I make anonymous access on the custom domain. I can download it through the Nuget package called Azure.Storage.Blobs with this connection string.

DefaultEndpointsProtocol=https;AccountName=websocketechoblobdev;AccountKey=xxxx;EndpointSuffix=core.windows.net

If I try to download it through the Nuget package called Azure.Storage.Blobs with this connection string. DefaultEndpointsProtocol=https;AccountName=websocketechoblobdev;AccountKey=xxxx;BlobEndpoint=https://websocketechotest.opnbibliotheca.com

I get this error:

Response x-ms-client-request-id 'e0e7c66d-0629-43f3-85a7-79034ae77d03' does not match the original expected request id, 'e18050d9-6057-43fe-aaa0-5e41e9aa410c'.
Status: 200 (OK)

Headers:

Content-MD5: /iAiKhL83XuGqgNErvqdpg==
X-Cache: REDACTED
x-ms-request-id: 89bbe80a-101e-002f-048f-3e59dc000000
x-ms-client-request-id: e0e7c66d-0629-43f3-85a7-79034ae77d03
x-ms-version: 2021-04-10
x-ms-creation-time: Mon, 14 Mar 2022 12:29:32 GMT
x-ms-lease-status: unlocked
x-ms-lease-state: available
x-ms-blob-type: BlockBlob
x-ms-server-encrypted: true
X-Azure-Ref-OriginShield: REDACTED
X-Azure-Ref: REDACTED
Accept-Ranges: bytes
Content-Length: 3459
Content-Type: application/x-pkcs12
Date: Wed, 23 Mar 2022 10:28:19 GMT
ETag: '0x8DA05B64AED6E28'
Last-Modified: Mon, 14 Mar 2022 12:29:32 GMT
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0

I found out that it works the first time I download the file but it fails with the exception above after that, it doesn't help to restart the program. It has something to do with it being HTTPS, if I set it up to HTTP it works.

Thanks

1 Answers

• Kindly please check the CNAME records created for the custom domain link used for blob storage in the second connection string as it should point to the hostname of your blob storage endpoint. Thus, creating the appropriate DNS records required for redirecting the access requests to the blob storage endpoint will ensure that the communication is successful, validated, and authentic.

For more information on the above to map the custom domain correctly to the Azure blob storage, please refer to the documentation link below: -

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-custom-domain-name?tabs=azure-portal#map-a-custom-domain-with-zero-downtime

• Secondly, would request you to please ‘Empty the cache and hard refresh’ the browser from where you are trying to access the Azure blob storage. Also, even though you might be trying to download the files from the blob storage through a program code using the connection string, please ensure that the code editor has been cleared of all the cache and temporary files and then the files from the blob storage are downloaded. This might negate the issue of the ‘x-ms-client-request-id’ header attribute being altered before leaving the ‘Azure.Storage.Blobs’ SDK.

• Finally, please take note that the custom domain name for any component of Azure storage only works for HTTP and not for HTTPS while the anonymous access enabled for the Azure blob containers from which files are to be downloaded are made publicly accessible as they are only supported for custom domain name access.

Related