azure-cli output config check added
Adds a check to contrib/azure-setup.sh which ensure the users azure-cli is configured to output json.
This commit is contained in:
parent
545b2c4e0f
commit
0f0fc1b99c
|
@ -12,6 +12,7 @@ azure_tenant_id= # Derived from the account after login
|
||||||
location=
|
location=
|
||||||
azure_object_id=
|
azure_object_id=
|
||||||
azureversion=
|
azureversion=
|
||||||
|
azurecliconfig=
|
||||||
create_sleep=10
|
create_sleep=10
|
||||||
|
|
||||||
showhelp() {
|
showhelp() {
|
||||||
|
@ -59,6 +60,15 @@ requirements() {
|
||||||
echo "Alternatively, you can use the Cloud Shell https://docs.microsoft.com/en-us/azure/cloud-shell/overview right from the Azure Portal or even VS Code."
|
echo "Alternatively, you can use the Cloud Shell https://docs.microsoft.com/en-us/azure/cloud-shell/overview right from the Azure Portal or even VS Code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
azurecliconfig=$(cat $HOME/.azure/config | grep output | awk -F'[ ]' '{print $3}')
|
||||||
|
if [ "$azurecliconfig" == "json" ]; then
|
||||||
|
found=$((found +1))
|
||||||
|
echo "Found correct azure-cli output configuration: output = $azurecliconfig."
|
||||||
|
else
|
||||||
|
echo "azure-cli is configured for $azurecliconfig output."
|
||||||
|
echo "Please reconfigure your azure-cli client to output using json."
|
||||||
|
fi
|
||||||
|
|
||||||
jqversion=$(jq --version)
|
jqversion=$(jq --version)
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
found=$((found + 1))
|
found=$((found + 1))
|
||||||
|
@ -68,7 +78,7 @@ requirements() {
|
||||||
echo "https://stedolan.github.io/jq/"
|
echo "https://stedolan.github.io/jq/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $found -lt 2 ]; then
|
if [ $found -lt 3 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue