更新时间:2023-11-17 13:27:58
在门户中,转到将VHD上传到的位置.确保有VHD.
当您单击容器中的VHD时,您将看到一个源URL.确保它与您在create命令中提供的URL相同
az磁盘创建\\
--resource-group myResourceGroup \
--name myManagedDisk \
-源https://mystorageaccount.blob.core.windows.net/mydisks/myDisk.vhd
如果一切正确,请关闭您的PowerShell实例,然后再次登录.
Login-AzureRMAccount
运行Get-AzureRMSubscription以查看您有权访问的所有订阅的列表.然后跑
Select-AzureRMSubscription -SubscriptionID SUBID
这将确保您选择了正确的订阅.再次尝试创建命令.
In the portal, go to the location you uploaded the VHD to. Ensure that the VHD is there.
When you click on the VHD in the container you will see a source URL. Make sure it is the same URL you are providing in the create command
az disk create \
--resource-group myResourceGroup \
--name myManagedDisk \
--source https://mystorageaccount.blob.core.windows.net/mydisks/myDisk.vhd
If that is all correct, close your PowerShell instance and login again.
Login-AzureRMAccount
Run Get-AzureRMSubscription to see a list of all subscriptions you have access to. Then run
Select-AzureRMSubscription -SubscriptionID SUBID
This will make sure you have the selected the correct subscription. Try the create command again.