$ mkdir -p ~/.local/var/az-cli-client42
$ az client42 login
$ az client42 resource list
Last active
August 29, 2019 18:49
-
-
Save maxwellb/41d37d1a6a0452707456d7be0c6fa054 to your computer and use it in GitHub Desktop.
docker az-cli wrapper for .bashrc
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
# 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