Skip to content

Instantly share code, notes, and snippets.

@kingnebby
Last active May 20, 2020 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingnebby/662966ed2eef28d415e1bf1dceeedf34 to your computer and use it in GitHub Desktop.
Save kingnebby/662966ed2eef28d415e1bf1dceeedf34 to your computer and use it in GitHub Desktop.
env-az function
env-az() {
# Display the current entry
echo -n "az subscription env ($AZ_SUB_ENV): "
# Read the user input into a new local var
read az_sub_env;
# If the user input was NOT empty then..
if [ ! -z "$az_sub_env" ]; then;
# Save the value as the new env var
export AZ_SUB_ENV=$az_sub_env;
fi;
# Do again for the other env var
echo -n "az aks instance env ($AZ_AKS_ENV): "
read az_aks_env;
if [ ! -z "$az_aks_env" ]; then;
export AZ_AKS_ENV=$az_aks_env;
fi;
# Call our previously defined function that will
# use these values to setup our cli env
env-az-setup;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment