Problem with azcopy

Robert Lescault 46 Reputation points
2022-12-29T20:59:25.053+00:00

Note: I'm new to this :-)

I am not one to give up easily but this has me stumped. I have googled and re-worked this multiple times, but I still can't get azcopy to successfully copy a local file to my blob container.

My latest and most familiar error:
RESPONSE Status: 403 This request is not authorized to perform this operation.

Here's what I am doing in my latest iteration:

azcopy login --tenant-id "abcdefg-1234-5678-adgj-12ed456gyh"
INFO: Login succeeded.
azcopy copy “C:\LocalFolder\LocalFile.txt” “https://myStorageAccount.blob.core.windows.net/myBLOBcontainer/<SAS-token>"

I am at the point where I think maybe my subscription level disallows me from using azcopy..is that a thing?
My level is "trial subscription",

Thanks in advance for any input.

I'm not a wizard at any of this, but I do learn quickly,

-Robert

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramya Harinarthini_MSFT 5,366 Reputation points Microsoft Employee Moderator
    2023-01-02T05:55:34.567+00:00

    @Robert Lescault Welcome to Microsoft Q&A, Thank you for posting your here!!

    From the error message we could see it is permission issue on the Storage account you need to add a role assignment to the user. Please go to Storage account -> Access Control -> Add -> Add role assignment, then add Storage Blob Data Owner to your login account and the try to upload the file to the Storage account without using the SAS token.

    azcopy login --tenant-id "abcdefg-1234-5678-adgj-12ed456gyh"
    azcopy copy 'C:\LocalFolder\LocalFile.txt' 'https://myStorageAccount.blob.core.windows.net/myBLOBcontainer'

    If you'd rather use a SAS token to authorize access to blob data, then you can append that token to the resource URL in each Az Copy command.

    For example: azcopy copy "/path/to/file.txt" "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]"

    Reference Article: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-upload#get-started

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.

    --------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Hoekstra Jelle 501 Reputation points
    2022-12-30T11:14:18.637+00:00

    Hi,

    What about if you don't use a SAS token in the copy command? (As you already logged in to the tenant.)
    If that doesn't work, let me know.

    REF:
    https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json

    Hope this helps!

    ----------

    If it does, please accept the answer and upvote


  2. Fabrice Bo 41 Reputation points
    2023-10-20T09:54:50.1933333+00:00

    Hi,

    You need to check with Azure Storage Explorer your upload and see if the new azcopy have not created folder in ingestiondata.

    I have troubleshoot this and it's ok for me. 403 error is a false positive so ...

    Hope this helps!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.