Skip to content

Instantly share code, notes, and snippets.

@ioggstream
Last active July 9, 2020 11:43
Show Gist options
  • Save ioggstream/8a51603efe6ea56f5be35aa7ffaeddc2 to your computer and use it in GitHub Desktop.
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.
# 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