Reputation: 1
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
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:
Portal:
Blob container:
File share:
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:
Portal:
Fileshare:
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.
Upvotes: 0