Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure File Storage URL in browser showing InvalidHeaderValue

I am trying to access the URL given in Azure for a file on the Azure File Storage format, however I am getting this error below. Is it possible to get this? Why would they offer a public URL when it's useless? Also how can I access this directly from IIS?

<Error> <Code>InvalidHeaderValue</Code> <Message> The value for one of the HTTP headers is not in the correct format. RequestId:5d681103-0a1a-00cc-5555-5s4849000000 Time:2016-02-04T14:06:50.1786949Z </Message> <HeaderName>x-ms-version</HeaderName> <HeaderValue/> </Error> 
like image 269
Mike Flynn Avatar asked Feb 04 '16 14:02

Mike Flynn


People also ask

What is the URL for Azure blob Storage?

By default, the URL for accessing the Blob service in a storage account is https://<your account name>. blob.core.windows.net.

How do I get Azure storage URL?

One way to find the URL of the blob is by using the Azure portal by going to Home > Storage Account > Container > Blob > Properties. However, probably the easiest way is to find the blob in the Storage Explorer, right-click, then select 'Copy URL'. This will copy the resource URL directly to the clipboard.

How do I access my Azure storage files?

You can mount the file share on your local machine by using the SMB 3.0 protocol, or you can use tools like Storage Explorer to access files in your file share. From your application, you can use storage client libraries, REST APIs, PowerShell, or Azure CLI to access your files in the Azure file share.

Does Azure storage explorer use SMB?

Azure Files is a service that offers file shares in the cloud using the standard Server Message Block (SMB) Protocol. Both SMB 2.1 and SMB 3.0 are supported.


2 Answers

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.

Shared Access Signature

like image 199
K232 Avatar answered Sep 21 '22 04:09

K232


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

like image 43
Andy Lai Avatar answered Sep 21 '22 04:09

Andy Lai