Skip to main content

Utility to switch Azure subscriptions

Project description

Switch Azure subscriptions

Upload Python Package

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.
  --help              Show this message and exit.

Example

az-switch
[1]: 5ddxxc0-xxxx-44c1-b12a-xxxb5dexxx: CompanyY PayAsYouGo
[2]: 882xx6c-xxxx-4121-912a-xxx25c8xxx: PersonalSubscription
[3]: d3fxx79-xxxx-4b11-812d-xxx974axxx: CompanyX INNOVATION
[4]: 8c1xx9e-xxxx-4e91-912c-xxx1842xxx: CompanyX Production
[5]: 26axxfb-xxxx-4ad1-8128-xxxf0eexxx: CompanyZ - staging
[6]: 463xx72-xxxx-4cf1-8125-xxxa803xxx: CompanyZ - prod
[7]: 29dxxe9-xxxx-4461-9123-xxxd5d5xxx: CompanyZ - dev
Switch [4]: 5
Active: 26axxfb-xxxx-4ad1-8128-xxxf0eexxx: CompanyZ - staging

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-0.0.5.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

az_account_switcher-0.0.5-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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