Hello Manikandan T,
Greetings! Welcome to Microsoft Q&A Platform.
Azure Storage currently does not support setting default response headers like Content-Type or Content-Encoding automatically during file upload. However, there are some ways you can manage and control these values:
-You can create an Azure Function or Logic App that triggers automatically upon the upload of a blob. This function can then set the appropriate Content-Type and Content-Encoding headers. This solution is flexible and can handle different content types as needed.
-After uploading your files, you can manually set the Content-Type to "application/octet-stream" and the Content-Encoding to "gzip" using Azure Storage Explorer, Azure CLI. For example, using the Azure CLI, you can update the blob properties as follows, az storage blob update --container-name <container-name> --name <blob-name> --content-type "application/octet-stream" --content-encoding "gzip" --account-name <storage-account-name>
-If you are using a programmatic approach, ensure that the correct metadata and properties are set right during or immediately after the upload. You can use the Azure Storage REST API.
-If you want to automate this process, consider using a script or a tool that sets these properties upon upload. This can be done programmatically using the Azure SDKs.
A similar issue is discussed in the Answer section of the following SO thread: https://stackoverflow.com/questions/23600229/what-content-type-header-to-use-when-serving-gzipped-files, https://stackoverflow.com/questions/50011759/azure-file-storage-content-type-is-always-application-octet-stream
Here is the doc for your reference: https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-properties?tabs=microsoft-entra-id
Hope this answer helps! please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members