Azure Batch Service - "Bad Request" when creating the VM-Pool

When working with the Azure Batch Service, you usually have to deal with many parameters. These parameters will be sent to the service, which in most cases during development time, will fail with “BadRequest” status.
If you take a look at the exception, you might see the following:

121442_batch%20service%20error

At the first view, you see many information that says nothing but “BadRequest”. To figure out the real cause oft he error, open InnerException and go to Response.Contet property.

{
  "odata.metadata":"https://***.westeurope.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element","code":"InvalidPropertyValue","message":{
    "lang":"en-US","value":"The value provided for one of the properties in the request body is invalid.\nRequestId:f1465ee3-18eb-44b7-8dfa-bae33749791e\nTime:2022-10-12T14:03:47.8955061Z"
  },"values":[
    {
      "key":"PropertyName","value":"imageReference"
    },{
      "key":"Reason","value":"The specified imageReference with publisher daenet offer WindowsServer-2022 sku datacenter-azure-edition is not supported."
    }
  ]
}

That property holds a detailed explanation of the error.


comments powered by Disqus