Can't upload a blob from an Azure VM

Gayman, Mark 21 Reputation points
2022-05-25T17:14:43.783+00:00

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 Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,351 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,717 questions
Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
318 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sumarigo-MSFT 43,801 Reputation points Microsoft Employee
    2022-05-25T17:36:19.967+00:00

    @Gayman, Mark 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 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Gayman, Mark 21 Reputation points
    2022-05-25T18:38:00.387+00:00

    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.

    0 comments No comments