将Azure VHD下载到本地使用Powershell [英] Download Azure VHD to local use powershell
问题描述
如何将具有Powershell的Azure VHD下载到本地计算机?
How can I download azure vhd with powershell to local machine?
I read the document, but I can't find the blob url like "https://XXX.blob.core.windows.net/vhds/XXX.vhd"
有人知道吗?
谢谢
推荐答案
根据您的描述,您的VM使用托管磁盘而不是非托管磁盘.因此,您无法在存储帐户中找到VHD文件.有关托管磁盘的更多信息,请参考以下链接.
According to your description, your VM uses managed disk not unmanaged disk. So, you could not find the VHD file in storage account. More information about managed disk please refer to this link.
如果要在托管磁盘中下载VHD,则应首先将其复制到存储帐户.
If you want to download the VHD in managed disk, you should copy it to a storage account first.
##create $SAS
$sas = Grant-AzureRmDiskAccess -ResourceGroupName shui -DiskName shuitest -DurationInSecond 3600 -Access Read
$destContext = New-AzureStorageContext –StorageAccountName contosostorageav1 -StorageAccountKey 'YourStorageAccountKey'
Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer 'vhds' -DestContext $destContext -DestBlob 'MyDestinationBlobName.vhd'
然后,您可以使用 Azcopy 将VHD下载到本地.
Then, you could use Save-AzureVhd
or Azcopy to download the VHD to your local.
请参阅类似的 查看全文