Steven Smit
Steven Smit

Reputation: 1

azcopy of directory failing when copying between blob storage and file share - cannot transfer to the root of a service

I am trying to copy an existing directory from a blob storage to a directory already existing in an azure file share via the Azure CLI in the Azure portal

I get the following error

failed to perform copy command due to error: cannot transfer individual files/folders to the root of a service. Add a container or directory to the destination URL

What I have tried

azcopy copy ' https://myazurename.blob.core.windows.net/subdirectory' 'https://myazurename.file.core.windows.net/blob-mirror/subdirectory' --recursive

azcopy copy ' https://myazurename.blob.core.windows.net/subdirectory/*' 'https://myazurename.file.core.windows.net/blob-mirror/subdirectory' --recursive

azcopy copy ' https://myazurename.blob.core.windows.net/subdirectory/*' 'https://myazurename.file.core.windows.net/blob-mirror/subdirectory/*' --recursive

Yet everything gives the same error

Upvotes: 0

Views: 1208

Answers (1)

Venkatesan
Venkatesan

Reputation: 10370

I tried in my environment and got below results:

Initially I have tried the same commands and got same error:

command:

 azcopy copy "https://<storage account name>.blob.core.windows.net/<c ontainer name>/directory1/?[SAS]" "https://<storage account name>.file.core.windows.net/fileshare1/directory1/" --recursive

Console: enter image description here

Portal:

Blob container:

enter image description here

File share:

enter image description here

After I added SAS in both blob and file url copied files successfully from blobstorage to fileshare:

command:

  azcopy copy "https://<storage account name>.blob.core.windows.net/<c ontainer name>/directory1/?[SAS]" "https://<storage account name>.file.core.windows.net/fileshare1/directory1/?[SAS]" --recursive=true

Console:

enter image description here

Portal:

Fileshare:

enter image description here

Update

You can get SAS for both blob and file

Home -> storageaccount -> shared access signature -> check the allowed resource group -> click the generate SAS and Connection string.

enter image description here

Upvotes: 0

Related Questions