Azure Stack Hub Marketplace - Custom OS Image

243 views Asked by At

Looking for help on publishing a custom OS image to the Azure Stack Hub Marketplace.

I have published a custom Windows image to the Azure Stack Hub Marketplace.

I can see the OS image in the marketplace but when I go to use it, after completing the values (e.g. name, password, disk type, location, etc) I get an error Selected image is not valid for the specified location. Select a different location

I can use the image from ARM templates and PowerShell to create a virtual machine, but I can't get it working in the marketplace. I suspect I'm missing data in createuidefinition.json from the .azpkg file but that is a guess only. It looks like this (and the imageReference data is correct).

{
  "handler": "Microsoft.Compute.SingleVm",
  "version": "0.0.1",
  "parameters": {
    "osPlatform": "Windows",
    "recommendedSizes": [
      "Standard_DS1_v2",
      "Standard_DS2_v2",
      "Standard_DS11_v2",
      "Standard_DS1",
      "Standard_DS2",
      "Standard_DS11",
      "Standard_D1_v2",
      "Standard_D1",
      "Standard_A1"
    ],
    "imageReference": {
      "publisher": "Contoso",
      "offer": "Windows",
      "sku": "Windows-Server-2016-Datacenter"
    },
    "diskType": "Premium",
    "dataDisks": [],
    "supportsSriov": true,
    "supportsBackup": true
  }
}

I have followed these two guides and figure some things out myself. The Microsoft document is hopeless.

https://learn.microsoft.com/en-us/azure-stack/operator/azure-stack-create-and-publish-marketplace-item?view=azs-2008&tabs=az

https://azurestack.blog/2016/10/adding-and-using-os-gallery-items-to-azure-stack-tp2/

Azure Stack Hub 2008 (though not patched since we installed it a few weeks ago, we are aware there are some updates to do).

1

There are 1 answers

0
SadiqhAhmed-MSFT On

@jimbo.19 This isn’t createuidef related.

We make a call to this api to determine if a particular image is valid for a location. /subscriptions/{1}/Providers/Microsoft.Compute/locations/{2}/Publishers/{3}/ArtifactTypes/VMImage/Offers/{4}/Skus/{5}/Versions{6} If this returns that versions exist, we consider it valid. If there aren’t any, we pop up that validation error you mentioned.