所选订阅无权访问此磁盘

The selected subscription does not have permissions to this disk

我正在尝试从未连接的托管 OS 磁盘创建新 VM。还原的 VM 必须在不同的订阅上。

我收到以下错误:

The selected subscription does not have permissions to this disk. Select a different disk or subscription with permissions to the disk.

当然不能选择不同的磁盘或订阅。唯一可行的选择是确保所选订阅具有磁盘权限。

如何确保所选订阅具有所需的磁盘权限?

您可以使用基于角色的访问控制 (RBAC) 在订阅之间共享图像。任何对映像版本具有读取权限的用户,即使是跨订阅的用户,也可以使用该映像版本部署虚拟机。

To list all the Shared Image Gallery resources across subscriptions that you have >access to on the Azure portal, follow the steps below:

  1. Open the Azure portal.
  2. Scroll down the page and select All resources.
  3. Select all the subscriptions under which you'd like to list all the resources.
  4. Look for resources of type Shared image gallery

To list all the Shared Image Gallery resources across subscriptions that you have permissions to, use the following command in the Azure CLI: Azure CLICopy

 az account list -otsv --query "[].id" | xargs -n 1 az sig list --subscription

您可以参考此 link1 link2 了解更多信息。

用于创建共享图像using CLI

用于创建共享图像using Powershell