Cannot access Windows azure file storage document
This is intended behavior. Please note that there's no anonymous access allowed for files stored in file storage. The access needs to be authorized. Since you're trying to access the resource without being authorized, you're getting this error.
One way of authorizing the access is to create a Shared Access Signature (SAS)
on a file/share level with Read
permission and then using that SAS URL to access the file.
This is happening because you are trying to access the file as an anonymous user. If you DO want to give access to anonymous users then create a SAS token and include that token in the URL:
- On Azure Portal: go to your storage account, then click on "Shared access Signature" and copy the SAS token:
Here's what worked for me:
Use NuGet package
"WindowsAzure.Storage"
instead of
"Microsoft.WindowsAzure.Storage"
In my case, blob.Exists()
and blob.AcquireLease()
would give me the HTTP Header exception (despite having the storage key/connection string available). The 2 packages above have the same API's (mostly), but the later gave me issues.