Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davenicoll/azure-subscription-chooser
A convenient and quick way of picking which Azure subscription/tenant to use with the Azure CLI
https://github.com/davenicoll/azure-subscription-chooser
az azure cli
Last synced: 30 days ago
JSON representation
A convenient and quick way of picking which Azure subscription/tenant to use with the Azure CLI
- Host: GitHub
- URL: https://github.com/davenicoll/azure-subscription-chooser
- Owner: davenicoll
- Created: 2020-10-08T19:13:09.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-03T17:28:34.000Z (8 months ago)
- Last Synced: 2024-05-04T19:33:55.573Z (8 months ago)
- Topics: az, azure, cli
- Language: Shell
- Homepage:
- Size: 13.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azure subscription chooser
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
``` shell
alias azsub="~/subscription-chooser.sh"
❯ azsub
`````` shell
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
```