Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy.sh script should not change default az cli settings #44

Open
asaikali opened this issue Aug 11, 2022 · 1 comment
Open

deploy.sh script should not change default az cli settings #44

asaikali opened this issue Aug 11, 2022 · 1 comment

Comments

@asaikali
Copy link
Collaborator

Currently the ./deploy.sh script makes a call to the function

function configure_defaults() {
  echo "Configure azure defaults resource group: $RESOURCE_GROUP and spring $SPRING_APPS_SERVICE"
  az configure --defaults group=$RESOURCE_GROUP spring=$SPRING_APPS_SERVICE location=${REGION}
}

It is surprising that the script changes the defaults settings for the az cli, it is better if the script uses the passed in args -r, -s, -g without changing defaults

function configure_defaults() {

@clarenceb
Copy link

Also, in the Create Azure Spring Apps service instance section of the README, it says to configure global defaults:

az configure --defaults \
    group=${RESOURCE_GROUP} \
    location=${REGION} \
    spring=${SPRING_APPS_SERVICE}

Personally, I think this is a bad idea and worse in the configure_defaults function mentioned above.

I prefer using a local scope for defaults with configure this file .azure/config without changing global defaults:

az configure --scope local --defaults \
    group=${RESOURCE_GROUP} \
    location=${REGION} \
    spring=${SPRING_APPS_SERVICE}

However, this is more useful for interactive use. For scripting, as @asaikali suggested above, it's probably better to just pass in args -r, -s, -g without changing defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants