how to copy vhd to RM based subscription using powershell?

前端 未结 1 374
迷失自我
迷失自我 2021-01-22 14:37

I am looking for Powershell script to copy vhd to subscription using Resource Manager deployment model.

相关标签:
1条回答
  • 2021-01-22 14:40

    vhd's are stored in Azure storage page blobs, and the storage API works independently of how an account is created (classic vs ARM). It's even independent of subscription. You just need your storage account's name and key.

    So you should just be able to copy via something like:

    $DestContext = New-AzureStorageContext -StorageAccountName "<name>"
       -StorageAccountKey "<key>"
    
    Start-AzureStorageBlobCopy -DestContainer "<containername>" -DestContext $DestContext
    

    And Start-AzureStorageBlobCopy should work the same, regardless how the storage account was created.

    0 讨论(0)
提交回复
热议问题