Forum Discussion
space3
Jan 17, 2021Copper Contributor
Azure subscription validation with Ansible
I would like to verify if an azure subscription exists using ansible. I tried using az account show -s {{sub}} but it fails with an error rather than returning that the "subscription doesn't exist m...
space3
Jan 19, 2021Copper Contributor
It is solved with jq. Thanks!
az account list | jq '.[] | select(.name == "{{sub_name}}")|.name'
az account list | jq '.[] | select(.name == "{{sub_name}}")|.name'