Azure File Storage URL in browser showing InvalidHeaderValue

坚强是说给别人听的谎言 提交于 2019-12-01 02:16:01
K232

Gaurav already mentioned a similar question here where it says you should use a "Shared Access Signature". In your storage account settings in Azure you'll find a topic "Shared Acess Signature". After clicking "Generate SAS" you'll get a "SAS Token" which you need to append to your URL.

If you use Azure File service to share your files, you have to add SAS token after your resources URL. e.g. https://testiiju5zra.file.core.windows.net/alexaskillaudio/lamb.mp3?sv=SDFCSGDJ01231%&SDDFXsuSDFSDSDSSFD

Alternatively, you can do the exact same things by using Azure Blobs as well. If you use Blobs, you don't have to add the extra token after resources URL. Just create a container on Blobs and make it public. And you can access your file like
https://testiiju5zra.blob.core.windows.net/blobaudiosource/lamb.mp3

Mike,
The error you received indicates that you are missing x-ms-version header. But once you set it, you will receive another error if you have not authenticated. You can refer to https://msdn.microsoft.com/en-us/library/azure/dn194274.aspx for list of required headers. Alternatively, you can use client library for the requests instead of REST API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!