Skip to content

Instantly share code, notes, and snippets.

@maxwellb
Last active August 29, 2019 18:49
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 maxwellb/41d37d1a6a0452707456d7be0c6fa054 to your computer and use it in GitHub Desktop.
Save maxwellb/41d37d1a6a0452707456d7be0c6fa054 to your computer and use it in GitHub Desktop.
docker az-cli wrapper for .bashrc
$ mkdir -p ~/.local/var/az-cli-client42
$ az client42 login
$ az client42 resource list
# Append to .bashrc
# $ declare -f az
az ()
{
local name;
if [ -d ${HOME}/.local/var/az-cli-${1} ]; then
name=${1};
shift;
else
name=default;
fi;
mkdir -p ${HOME}/.local/var/az-cli-${name};
docker run --name az-cli-${name} --rm -v ${HOME}/.local/var/az-cli-${name}:/root -i microsoft/azure-cli:latest az $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment