AzCopy between containers and include metadata and blob index tags

Sriram Mallajyosula 20 Reputation points
2025-04-10T19:54:29.7566667+00:00

Hi,

I am trying to use the AzCopy tool to copy between a source and destination container within the same storage account. I provided all the permissions for the SAS token but still it does not work. Below is the command I tried. Please help.

azcopy copy "https://appstg43454546.blob.core.windows.net/source/?sp=racwdl&st=2025-04-09T21:36:49Z&se=2025-04-12T05:36:49Z&spr=https&sv=2024-11-04&sr=c&sig=xxxxxxxx" "https://appstg43454546.blob.core.windows.net/destination/?sp=racwdl&st=2025-04-09T21:37:24Z&se=2025-04-12T05:37:24Z&spr=https&sv=2024-11-04&sr=c&sig=xxxxx" --recursive=true --s2s-preserve-blob-tags=true

Please let me know

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.
3,467 questions
0 comments No comments
{count} votes

Accepted answer
  1. Abdelaziz Khajour 235 Reputation points Microsoft Employee
    2025-04-10T20:45:38.36+00:00

    Hello Sriram Mallajyosula

    Your SAS tokens (racwdl permissions) only apply to individual containers. For cross-container copies within the same storage account, use an account-level SAS instead.

    Fix: Regenerate the account-level SAS token with with account-level scope as shown bellow:

    azcopy copy "https://{storage}.blob.core.windows.net/{source-container}/?{token}" "https://{storage}.blob.core.windows.net/{destination-container}?{token}" --recursive
    

    SAS options to be selected:

    Screenshot 2025-04-10 at 22.43.50

    I hope this has been helpful!

    Please click "Accept" the answer as original posters help the community find answers faster by identifying the correct answer.

    Abdelaziz

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Venkatesan S 1,550 Reputation points Microsoft External Staff
    2025-04-11T11:00:38.1366667+00:00

    Hi Sriram Mallajyosula

    AzCopy between containers and include metadata and blob index tags <Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.RequestId:xxxxTime:2025-04-11T10:14:42.0449907Z</Message></Error>

    The above error occurs when you do not have the proper permissions to copy a blob with index tags with a container in the same storage account in your environment.

    Portal:

    enter image description here

    As you can see in the image above, there is no tag permission to copy the blob between containers. Therefore, using a Container-level SAS token, you are not able to copy blobs with index tags between the source and destination containers within the same storage account.

    If you need to perform this operation, you must generate a SAS token at the Account level to copy blobs with index tags between the source and destination containers within the same storage account.

    SAS token:
    enter image description here

    Here is the Account level SAS token with parameter.
    sv=2024-11-04&ss=b&srt=sco&sp=rwdlactf&se=2025-04-11T18:45:11Z&st=2025-04-11T10:45:11Z&spr=https&sig=Redacted

    Now using the above sas token with your command I can able to copy blobs with Blob index tags between a source and destination container within the same storage account.

    Command and Output:

    PS C:\Users\xxxx> azcopy copy "https://venkat326123.blob.core.windows.net/sample1?sv=2024-11-04&ss=b&srt=sco&sp=rwdlactf&se=2025-04-11T18:45:11Z&st=2025-04-11T10:45:11Z&spr=https&sig=redacted" "https://venkat326123.blob.core.windows.net/diskcontainer/?sv=2024-11-04&ss=b&srt=sco&sp=rwdlactf&se=2025-04-11T18:45:11Z&st=2025-04-11T10:45:11Z&spr=https&sig=redacted" --recursive=true --s2s-preserve-blob-tags=true
    INFO: Scanning...
    INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
    
    Job xxxx has started
    Log file is located at: C:\Users\xxx\.azcopy\3xxxx.log
    
    100.0 %, 4 Done, 0 Failed, 0 Pending, 0 Skipped, 4 Total, 2-sec Throughput (Mb/s): 95.7279
    
    
    Job xxxxxxxx summary
    Elapsed Time (Minutes): 0.0335
    Number of File Transfers: 4
    Number of Folder Property Transfers: 0
    Number of Symlink Transfers: 0
    Total Number of Transfers: 4
    Number of File Transfers Completed: 4
    Number of Folder Transfers Completed: 0
    Number of File Transfers Failed: 0
    Number of Folder Transfers Failed: 0
    Number of File Transfers Skipped: 0
    Number of Folder Transfers Skipped: 0
    Total Number of Bytes Transferred: 24050701
    Final Job Status: Completed
    

    enter image description here

    Portal:

    enter image description hereHope this answer helps! please let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and "Yes" for was this answer helpful. this can be beneficial to other community members.

    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.