Open binnie268 opened 3 years ago
storage
Hi @binnie268, thanks for your feedback. Currently you could use --source-uri
with snapshot url to copy from snapshot as below:
az storage file copy start-batch --source-uri https://xxx.file.core.windows.net/test?sharesnapshot=2020-11-25T03%3A06%3A49.0000000Z --destination-share test1 --account-name xxxx
Hi @Juliehzl, I just tried the command but the behaviour was not expected:
az storage file copy start-batch --account-name test001 --account-key XXXXXXXXX --source-uri "https://test001.file.core.windows.net/testshare001?sharesnapshot=2020-11-23T04:26:03.0000000Z" --destination-share testshare001
I can see that my snapshot has files inside it, but the copy was empty. This was the output
copy files or blobs to file share
account test001
share testshare001
path None
source testshare001
source type file
pattern None
operations
[]
@zhangyan133 could you take a look?
hi, i am facing the same issue. is there any update?
Hi, is there a plan to make this work?
This is the result of my running az storage file copy start-batch --source-uri "https://jonieaccount.file.core.windows.net/jonieshare?sharesnapshot=2022-04-15T08:25:59.0000000Z" --destination-share jonieshares --account-name jonieaccount
command. Maybe you can upgrade the CLI version and try again.
Azure CLI version:
azure-cli 2.35.0
core 2.35.0
telemetry 1.0.6
This is the result of my running
az storage file copy start-batch --source-uri "https://jonieaccount.file.core.windows.net/jonieshare?sharesnapshot=2022-04-15T08:25:59.0000000Z" --destination-share jonieshares --account-name jonieaccount
command. Maybe you can upgrade the CLI version and try again. Azure CLI version: azure-cli 2.35.0 core 2.35.0 telemetry 1.0.6
You are right this looks like it is working, but in reality it does not. While you are right, it is copying files, it is not copying them from the snapshot but directly from the share. Just tested it.
@evelyn-ys I think this may be a service bug. Can you tag it with service attention?
My workaround is to generate SAS with AZ CLI, then use AzCopy to copy from the snapshot. I can confirm that this is working.
echo "Get SAS Key and Create snapshot..."
tomorrow=$(date --date="tomorrow" +"%Y-%m-%d")
sasKey=$(az storage account generate-sas --https-only --permissions rwlc --services f -o tsv --account-name $storName --resource-types sco --expiry $tomorrow)
snapshotName=$(az storage share snapshot --name $oldShare --account-name $storName --query "snapshot" -o tsv)
echo "Got SAS Key and Created snapshot."
echo "Files will be copied from $oldShare to $newShare..."
azcopy copy "https://$storName.file.core.windows.net/$oldShare?$sasKey&sharesnapshot=$snapshotName" "https://$storName.file.core.windows.net/$newShare?$sasKey" --recursive
echo "Copied files from $oldShare to $newShare."
echo "Removing snapshot..."
az storage share-rm delete --storage-account $storName --name $oldShare --snapshot $snapshotName
echo "Removed snapshot."
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
Author: | binnie268 |
---|---|
Assignees: | evelyn-ys |
Labels: | `Storage`, `Service Attention`, `feature-request` |
Milestone: | Backlog |
Is your feature request related to a problem? Please describe.
az storage file copy start-batch does not support snapshot restore
Describe the solution you'd like Describe the solution you'd like Wanted to check if we could add
--file-snapshot
and/or--snapshot
support foraz storage file copy start-batch
? Right now file snapshot is only supported on az storage file copy startBy adding the snapshot, we can restore all files from our file share snapshot to the same file share or a different file share.
Describe alternatives you've considered
Additional context
Thanks!