Copy Storage Account to a different resource group.

Jessie 85 Reputation points
2024-12-03T02:04:47.6466667+00:00

Hello there,

I plan to copy my storage account to a different resource group using the azcopy command.

The document below recommends appending the SAS key to the source or destination URL in the command if the authentication method is not Microsoft Entra ID.

Problem:

I noticed there are commands for copying blobs, directory and containers independently and there is also a command for copying them at once.

Looking at the structure of my storage account, I am not sure exactly will be copied.

Question:

  1. Going by the structure of my storage account, what exactly does the below command copy?

azcopy copy 'https://mysourceaccount.blob.core.windows.net/''https://mydestinationaccount.blob.core.windows.net' --recursive

  1. In the case where authentication is not Microsoft Entra ID, I understand that I need to append a SAS key to the command but when I run the below command for blob, does it copy $logs, $web and data as seen in the screenshot?

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myTextFile.txt' 'https://mydestinationaccount.blob.core.windows.net/mycontainer/myTextFile.txt'

  1. Is there a way to append a SAS key to the below command for a one-time copy?

azcopy copy 'https://mysourceaccount.blob.core.windows.net/''https://mydestinationaccount.blob.core.windows.net' --recursive

  1. What command copies File shares, Queues and Tables?

https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-copy

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,265 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,969 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amrinder Singh 5,155 Reputation points Microsoft Employee
    2024-12-03T02:40:42.3633333+00:00

    Hi Jessie - Thanks for reaching out over Q&A Forum,

    For #1

    Copy all blob containers, directories, and blobs from storage account to another by using a SAS token:

    azcopy cp "https://[srcaccount].blob.core.windows.net?[SAS]" "https://[destaccount].blob.core.windows.net?[SAS]" --recursive=true

    For#2,

    You have trying to copy specifically one file only in the example you shared.

    For #3,

    Yes, you can generate one and add that to your command similar to the format I shared in #1

    For #4,

    For Files - Below is list of specific scenarios that are supported and Files to Files seems not supported as per documentation.

    https://learn.microsoft.com/en-us/azure/storage/common/storage-ref-azcopy-copy#synopsis

    For Queues - It is not supported

    For Tables - It is supported with only one older version 7.3. You can try leveraging that.

    Hope that helps!

    Let me know if there are any queries/concerns, will be glad to assist.


    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.


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.