Skip to main content

Utility to switch Azure subscriptions

Project description

Switch Azure subscriptions

Type Badge
Release workflow !Workflow upload
DeepSource DeepSource

Problem: Switching subscriptions using the Azure CLI involves too much typing.

# Type a lot...
az account list --output table

# Use mouse to select the subscription-id in the console
# Use ctrl-c to copy the text, this might be optional 

# Type a lot...
az account set --subscription-id <paste subscription-id>

Solution: I simplified this task with the command-line utility az-switch! The active subscription is bold and green and selected as default argument. Just select the subscription you want to activate.

Install

pip install az-account-switcher

Usage

Usage: az-switch [OPTIONS]

  Show all Azure Subscriptions in current profile using the `az` command-
  line utility. Ask user input for switching to another subscription.

Options:
  -n INTEGER  Switch to this subscription number directly.
  -v          Verbose: echo the azure-cli commands.
  -h, --help  Show this message and exit.

Example

example_gif

CHANGELOG

v1.1.0 (04-05-2021):

  • Don't switch when same subscription is selected.
  • Add -v verbose flag to print Azure-CLI sub-commands.
  • Add -h as alias for --help

Thanks to @tqorange for contributing.

v1.0.0 (08-04-2021):

  • Include Python 3.6, not only greater than.
  • Add DeepSource code checker and resolve found issue (related to shell=true)
  • Add aliases for command-line next to az-switch: + az-account-switch + az-account-switcher (the package name)
  • Dump to v1.0.0, since it's working fine for a while and looks better!

v0.0.6 (25-03-2021):

Add support for disabled subscriptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

az-account-switcher-1.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

az_account_switcher-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file az-account-switcher-1.1.0.tar.gz.

File metadata

  • Download URL: az-account-switcher-1.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for az-account-switcher-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c99bf08d6a6bfa38498e464a18fa7fb790bd782c9ea05aac7c312d25a891dcc1
MD5 1d828db79a21cd79ee71770a9b351c05
BLAKE2b-256 7d18202f0f4c95a00bae55b733519c8caa32161b0d560524792339763e38602d

See more details on using hashes here.

File details

Details for the file az_account_switcher-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: az_account_switcher-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for az_account_switcher-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e73a3e6be53daf8e468cfc77c88b26fb58748b603b8c0401248b76fe4775e9c6
MD5 9af36cb002abb86fc41ba631e9563509
BLAKE2b-256 eddb98a0249838f07cbc63e92f8c8edbfc359e2382847f8c3e1c37306ac78990

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page