1

我创建了 Azure 托管应用程序。我使用托管映像mainTemplate.json来创建新的虚拟机,例如:

{
    "type": "Microsoft.Compute/images",
    "apiVersion": "2018-04-01",
    "name": "front-image",
    "location": "[parameters('location')]",
    "properties": {
        "storageProfile": {
            "osDisk": {
                "osType": "linux",
                "osState": "Generalized",
                "blobUri": "[concat('https://sdfasdfasdf.blob.core.windows.net/images/myserver.vhd')]",
                "caching": "ReadWrite",
                "storageAccountType": "Standard_LRS"
            }
        }
    }
}, {
    "apiVersion": "2016-04-30-preview",
    "type": "Microsoft.Compute/virtualMachines",
    "name": "myserver",
    "location": "[parameters('location')]",
    "dependsOn": ["myserver-nic", "myserver-images"],
    "properties": {
        "storageProfile": {
            "imageReference": {
                "id": "[resourceId('Microsoft.Compute/images', 'myserver-image')]"
            }
        },
        ...
    }
}

这在服务目录中运行良好。但是当我尝试从 Azure Marketplace 部署应用程序时,出现下一个错误:

源 blob https://sdfasdfasdf.blob.core.windows.net/images/myserver.vhd不属于订阅 ****** 中的存储帐户。

在 Azure常见问题解答中,我发现了下一个:

问:我可以使用 Azure 存储帐户中的 VHD 文件来创建具有不同订阅的托管磁盘吗?

答:是的。

我做错了什么?

4

3 回答 3

1

这只适用于一些怪癖。基本上你需要做类似的事情。因此,使用某种第三方机制在客户订阅中创建图像。您不能跨订阅使用图像(至少在撰写本文时)。

于 2019-01-23T15:29:22.583 回答
1

市场中不允许这样做(将无法通过认证)。市场报价(托管应用或解决方案模板)中使用的任何 vm 映像都必须作为 VM 报价发布到 Azure 市场。它可以被隐藏(因此用户不直接部署图像),但仍需要在市场中。

于 2019-01-25T03:10:29.007 回答
1

对 blob 容器的访问级别似乎有问题。请检查一下,它应该是公开的,而不是私有的。所以你不应该在你的图像中存储任何秘密。

于 2019-01-23T16:32:58.103 回答