Last active
July 9, 2020 11:43
-
-
Save ioggstream/8a51603efe6ea56f5be35aa7ffaeddc2 to your computer and use it in GitHub Desktop.
Bash function to use azure-cli without installing all that stuff on your laptop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# azure cli, if you don't want to install node on your laptop | |
az(){ | |
# Prepend az if you run this function with parameters | |
if [ "$#" -gt "0" ]; then | |
set -- az "$@" | |
fi | |
docker run --rm -it -u $UID \ | |
-v $PWD:/code \ | |
-v $HOME/.kube-azure:/.kube \ | |
-v $HOME/.azure:/root/.azure \ | |
-v $HOME/.local/bin:/ext/bin \ | |
mcr.microsoft.com/azure-cli "$@" | |
} | |
# Kubectl using the azure path | |
kc(){ | |
kubectl --kubeconfig ~/.kube-azure/config "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment