Recently I authored some ARM stuff in Visual Studio and I had a need for getting the current subscription ID the template is being deployed to. So there is a helper function you can call like this…
“subscriptionId”: “[subscription().subscriptionId]”
I used it in the template like this…
…but as soon I tried to deploy the template, I hit this error all the time…
“code”: “BadRequest”, “message”: “{\”Message\”:\”The request is invalid.\”,\”ModelState\”:{\”variable.properties.value\”:[\”Invalid JSON primitive: 328de222-1a51-458a-96be-6770259e84c0.\”]}}”
I am not sure why this happen, but I figured out a workaround. If I concatenate the entire subscription id, it would work like this…
I hope this saves you some headache!