Warm tip: This article is reproduced from serverfault.com, please click

Azure cli virtual machine scale sets tutorial fails with "Parameter 'osProfile' is not allowed."?

发布于 2020-12-03 01:18:19

Follwing https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/tutorial-use-custom-image-cli fails here with the error

...
$ az vmss create --resource-group myResourceGroup --name myScaleSet --image /subscriptions/.../myGallery/images/myImageDefinition
Deployment failed. Correlation ID: 6c5f031b-aa0e-42a8-a1d9-faba9b11b208. {
  "error": {
    "code": "InvalidParameter",
    "message": "Parameter 'osProfile' is not allowed.",
    "target": "osProfile"
  }
}

Any suggestions? You can reproduce this easily using the script https://github.com/dankegel/azure-scripts/blob/main/ss-demo.sh

Questioner
Dan Kegel
Viewed
0
Nancy Xiong 2020-12-03 15:37:03

I can reproduce the error with your script. The problem is that there is a missing "\" after the parameter --image $IDID in your script.

az vmss create \
   --resource-group myResourceGroup \
   --name myScaleSet \
   --image $IDID
   --specialized

It should be

az vmss create \
   --resource-group myResourceGroup \
   --name myScaleSet \
   --image $IDID \
   --specialized