question

GaymanMark-3623 avatar image
0 Votes"
GaymanMark-3623 asked GaymanMark-3623 answered

Can't upload a blob from an Azure VM

I am trying to upload a blob from my Azure Debian VM to an Azure Data Lake Gen2 Storage Container, both of which I configured under my Azure account. My code, written in Python, faults with this abridged exception report:

Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationFailure</Code><Message>This request is not authorized to perform this operation.

I run the code from a ssh terminal that is logged into the VM.

The code runs without exception from my local development machine.

Is this a firewall or rights issue or something else? What change is needed to prevent this exception?

azure-storage-accountsazure-data-lake-storageazure-vmware-solution
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SumanthMarigowda-MSFT avatar image
1 Vote"
SumanthMarigowda-MSFT answered GaymanMark-3623 commented

@GaymanMark-3623 Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

Can you provide access 'Storage Blob Data Contributor' ( IAM > Add role assignment, and add the special permissions for this type of request:) RBAC role to the Storage account and add a firewall exception on the storage with the IP (Storage accounts > {yourAccount} > Networking > Firewalls and Virtual networks)

Steps:- Azure Portal -> Storage Account -> Networking -> Check Allow Access From (All Networks / Selected Networks)
If it is "Selected Networks" - It means the storage account is firewall enabled.

If the issue still persist, Can you please use azcopy tool to upload files to blob for testing purpose


Also, please refer to this thread, which explain How RBAC works

Couple of additional work arounds mentioned here
https://stackoverflow.com/questions/24492790/azurestorage-blob-server-failed-to-authenticate-the-request-make-sure-the-value

Please let us know if you have any further queries. I would like to work closer on this issue.


Please do not forget to 205584-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That worked. The previous setting was Enabled from selected virtual networks and IP addresses.

Is there any way I can narrow the scope to just access from within the Azure infrastructure?

0 Votes 0 ·
GaymanMark-3623 avatar image
0 Votes"
GaymanMark-3623 answered

I can answer my own question--switch the storage account public network access back to Enabled from selected virtual networks and IP addresses and add the vnet of the VM, or the Azure account resource, into the allowed existing virtual networks of the storage account.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.