Skip to content

A convenient and quick way of picking which Azure subscription/tenant to use with the Azure CLI

Notifications You must be signed in to change notification settings

davenicoll/azure-subscription-chooser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Azure subscription chooser

accessibility text

An interactive bash script enabling you to change Azure subscription quickly without leaving the CLI. The script can be run standalone (./azure-subscription-chooser.sh), or called from another script like a function...

Example usage

alias azsub="~/subscription-chooser.sh"
❯ azsub
SUBSCRIPTION=`. ".subscription-chooser.sh"`
if [ -z $SUBSCRIPTION ]; then echo "You chose nothing!"; else; echo "You chose $SUBSCRIPTION"; fi

Dependencies

whiptail is required to create the menu, as most distros have it installed already. https://en.wikibooks.org/wiki/Bash_Shell_Scripting/Whiptail

jq is required to process the json response from az.

Install whiptail on macOS

whiptail isn't installed on macOS, but can be installed with brew (https://command-not-found.com/whiptail) and the package is called newt.

brew install newt

About

A convenient and quick way of picking which Azure subscription/tenant to use with the Azure CLI

Topics

Resources

Stars

Watchers

Forks

Languages