使用Powershell Save-AzureVhd備份VHD檔案收到403

使用Powershell Save-AzureVhd備份VHD檔案收到403

我正在執行以下命令:

Save-AzureVhd -Source "http://portalvhdsxg6g1pj669bv1.blob.core.windows.net/vhds/{my_vhd_name}.vhd" -LocalFilePath "D:\Virtual Machine Backups\AzureVM.vhd" -NumberOfThreads 5

當我從 powershell 執行上述命令時,我收到:

Save-AzureVhd : The remote server returned an error: (403) Forbidden.
At line:1 char:1
+ Save-AzureVhd -Source "http://portalvhdsxg6g1pj669bv1.blob.core.windows.net/vhds ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Save-AzureVhd], StorageException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Storage.StorageException,Microsoft.WindowsAzure.Commands.ServiceM
   anagement.StorageServices.SaveAzureVhdCommand

我已載入從 Azure 網站下載的發佈設定檔。設定檔案已成功匯入,並且可以看到我的訂閱。

知道為什麼我會收到 403 錯誤嗎?我目前正在免費試用。這可能是問題所在嗎?即使您擁有正確的訂閱憑證,下載 Azure VHD 是否有與計費相關的限制?

答案1

要嘗試的一件事:指定-StorageKey.我知道您匯入了發佈設定文件,但是...如果您指定儲存金鑰,該金鑰將用於存取儲存帳戶,而不必擔心透過發佈設定找到的內容。這消除了發佈設定檔匯入的任何潛在問題,特別是當您有多個訂閱並且沒有將正確的訂閱設定為預設訂閱時。

相關內容