我有一个虚拟机磁盘快照,并尝试将其复制到 Azure 容器。
如何使用 Azure 门户手动执行此操作?
我尝试使用 az cli 来执行此操作,如下所示:
$subscriptionId="<subscriptionId>"
$resourceGroupName=myResourceGroupName
$snapshotName=mySnapshotName
$sasExpiryDuration=3600
$storageAccountName=mystorageaccountname
$storageContainerName=mystoragecontainername
#Provide the key of the storage account where you want to copy snapshot.
$storageAccountKey=mystorageaccountkey
#Provide the name of the VHD file to which snapshot will be copied.
$destinationVHDFileName=myvhdfilename
az account set --subscription $subscriptionId
$sas=$(az snapshot grant-access --resource-group $resourceGroupName --name $snapshotName --duration-in-seconds $sasExpiryDuration --query [accessSas] -o tsv)
az storage blob copy start --destination-blob $destinationVHDFileName --destination-container $storageContainerName --account-name $storageAccountName --account-key $storageAccountKey --source-uri $sas
但复制似乎没有给出错误:
ERROR: unrecognized arguments: https://.....
我认为这是针对 --source-uri 的?
如何将资源组中的磁盘快照复制到 Azure 容器?