问题
I created Azure Managed Application. I used managed images in mainTemplate.json
to create new VMs, like in example:
{
"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')]"
}
},
...
}
}
This work well in Service catalog. But when I trying deploy application from Azure Marketplace, I have next error:
The source blob https://sdfasdfasdf.blob.core.windows.net/images/myserver.vhd does not belong to a storage account in subscription ****** .
In Azure FAQ I found next:
Q: Can I use a VHD file in an Azure storage account to create a managed disk with a different subscription?
A: Yes.
What I doing wrong?
回答1:
This is not allowed in the Marketplace (will fail certification). Any vm images used in a marketplace offer (managed app or solution template) must be published to the Azure Marketplace as a VM offer. It can be hidden (so users don't deploy the image directly) but still needs to be in the marketplace.
回答2:
this can only work with some quirks. basically you need to do something akin to this. So use some sort of third party mechanism to create an image in the customer subscription. you cannot use images across subscriptions (at least at the time of writing).
回答3:
It seems something is wrong with access level to the blob container. Check it please, it should be public, not private. So you should not store any secrets in your image.
来源:https://stackoverflow.com/questions/54329588/azure-marketplace-is-it-possible-to-use-images-in-managed-application-offer