Thanks for the reply, this is what i need, but i need the string read from the command line. SInce you may not have the the azure cli, i tried to replace the jsaon data source with a URL, here is the code
Some times azure cli returns differnt type of json object. For example, when i create a Virtual Machine, if sucess, it return one type of json string, that include server IP, server name, etc… If it fail for some reason, the structure of JSON string returned is differnt. How can i handle such situations ?
@johandalabacka yes, it is differnt. Here is what you get when you have an error
boby@sok-01:~$ az vm create \
> --resource-group myResourceGroupAutomate \
> --name myVM \
> --image UbuntuLTS \
> --admin-username boby \
> --admin-password password123 \
> --location eastasia
Deployment failed. Correlation ID: 2cd9a3ce-43c2-4bad-bf3a-9a137a8deb9d. {
"error": {
"code": "SkuNotAvailable",
"message": "The requested size for resource '/subscriptions/da87b641-e192-4863-a66a-40e11b8741f7/resourceGroups/myResourceGroupAutomate/providers/Microsoft.Compute/virtualMachines/myVM' is currently not available in location 'eastasia' zones '' for subscription 'da87b641-e192-4863-a66a-40e11b8741f7'. Please try another size or deploy to a different location or zones. See https://aka.ms/azureskunotavailable for details."
}
}
boby@sok-01:~$