## Switch Azure subscriptions
| Type| Badge|
|---|---|
| Workflow | [![Test](https://github.com/abij/az-account-switcher/actions/workflows/test.yml/badge.svg)](https://github.com/abij/az-account-switcher/actions/workflows/test.yml) ![!Workflow upload](https://github.com/abij/az-account-switcher/workflows/Upload%20Python%20Package/badge.svg)|
|Latest|![!PyPI](https://img.shields.io/pypi/v/az-account-switcher.svg)|
|Activity|![!PyPI](https://img.shields.io/pypi/dm/az-account-switcher)|
| DeepSource | [![DeepSource](https://deepsource.io/gh/abij/az-account-switcher.svg/?label=active+issues&show_trend=true)](https://deepsource.io/gh/abij/az-account-switcher/?ref=repository-badge) |
Problem: Switching subscriptions using the [Azure CLI](https://docs.microsoft.com/cli/azure/manage-azure-subscriptions-azure-cli) involves too much typing.
```bash
# 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
```bash
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 Verbose: echo the azure-cli commands.
-h, --help Show this message and exit.
```
### Example
![example_gif](https://raw.githubusercontent.com/abij/az-account-switcher/master/az-switch-example.gif)
## CHANGELOG
### v1.4.0 (28-12-2023):
- Removed `az.cli` with `azure-cli` dependencies in favor subprocess call to have a small installation. Assuming `az` in on your PATH.
- Drop Python 3.7 support, due to minimal version supported by (dev) dependency `commitizen`.
- Switch to [poetry](https://python-poetry.org/) for dependency management.
### v1.3.0 (25-02-2022):
- Fixed: [issue-8](https://github.com/abij/az-account-switcher/issues/8) **NotImplementedError** by removing deprecated `get_azure_cli_credentials` in [PR-6](https://github.com/abij/az-account-switcher/pull/6).
- **Speed-up switching** by removing the online interaction pulling the Subscriptions through the Azure-CLI. [PR-7](https://github.com/abij/az-account-switcher/pull/7)
- Add `--verbose` flag as an alias to the `-v` flag.
### v1.2.0 (31-05-2021):
- Support Windows by changing interaction with Azure-CLI using Python package 'az.cli' instead of POpen
- Drop Python 3.6 support, due to dependent package 'az.cli'
- Unit tests running on latest versions of Unix, Windows and MacOs
- Depend on `azure-cli` instead of `azure-cli-core` to auto include `packaging`to fix [issue-3](https://github.com/abij/az-account-switcher/issues/3)
### 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/abij/az-account-switcher",
"name": "az-account-switcher",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "azure,cli,subscription,management",
"author": "Alexander Bij",
"author_email": "Alexander.Bij@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/15/18/9040393cc68fc0ce0cf5752601430f3829d9d52da69e2aa317e7cfebf931/az_account_switcher-1.4.0.tar.gz",
"platform": null,
"description": "## Switch Azure subscriptions\n\n| Type| Badge|\n|---|---|\n| Workflow | [![Test](https://github.com/abij/az-account-switcher/actions/workflows/test.yml/badge.svg)](https://github.com/abij/az-account-switcher/actions/workflows/test.yml) ![!Workflow upload](https://github.com/abij/az-account-switcher/workflows/Upload%20Python%20Package/badge.svg)|\n|Latest|![!PyPI](https://img.shields.io/pypi/v/az-account-switcher.svg)|\n|Activity|![!PyPI](https://img.shields.io/pypi/dm/az-account-switcher)|\n| DeepSource | [![DeepSource](https://deepsource.io/gh/abij/az-account-switcher.svg/?label=active+issues&show_trend=true)](https://deepsource.io/gh/abij/az-account-switcher/?ref=repository-badge) |\n\nProblem: Switching subscriptions using the [Azure CLI](https://docs.microsoft.com/cli/azure/manage-azure-subscriptions-azure-cli) involves too much typing.\n\n```bash\n# Type a lot...\naz account list --output table\n\n# Use mouse to select the subscription-id in the console\n# Use ctrl-c to copy the text, this might be optional\n\n# Type a lot...\naz account set --subscription-id <paste subscription-id>\n```\n\nSolution: 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.\n\n### Install\n\n`pip install az-account-switcher`\n\n### Usage\n\n```bash\nUsage: az-switch [OPTIONS]\n\n Show all Azure Subscriptions in current profile using the `az` command-\n line utility. Ask user input for switching to another subscription.\n\nOptions:\n -n INTEGER Switch to this subscription number directly.\n -v, --verbose Verbose: echo the azure-cli commands.\n -h, --help Show this message and exit.\n```\n\n### Example\n\n![example_gif](https://raw.githubusercontent.com/abij/az-account-switcher/master/az-switch-example.gif)\n\n## CHANGELOG\n\n### v1.4.0 (28-12-2023):\n\n- Removed `az.cli` with `azure-cli` dependencies in favor subprocess call to have a small installation. Assuming `az` in on your PATH.\n- Drop Python 3.7 support, due to minimal version supported by (dev) dependency `commitizen`.\n- Switch to [poetry](https://python-poetry.org/) for dependency management.\n\n### v1.3.0 (25-02-2022):\n\n- Fixed: [issue-8](https://github.com/abij/az-account-switcher/issues/8) **NotImplementedError** by removing deprecated `get_azure_cli_credentials` in [PR-6](https://github.com/abij/az-account-switcher/pull/6).\n- **Speed-up switching** by removing the online interaction pulling the Subscriptions through the Azure-CLI. [PR-7](https://github.com/abij/az-account-switcher/pull/7)\n- Add `--verbose` flag as an alias to the `-v` flag.\n\n### v1.2.0 (31-05-2021):\n\n- Support Windows by changing interaction with Azure-CLI using Python package 'az.cli' instead of POpen\n- Drop Python 3.6 support, due to dependent package 'az.cli'\n- Unit tests running on latest versions of Unix, Windows and MacOs\n- Depend on `azure-cli` instead of `azure-cli-core` to auto include `packaging`to fix [issue-3](https://github.com/abij/az-account-switcher/issues/3)\n\n### v1.1.0 (04-05-2021):\n\n- Don't switch when same subscription is selected.\n- Add `-v` verbose flag to print Azure-CLI sub-commands.\n- Add `-h` as alias for `--help`\n\nThanks to @tqorange for contributing.\n\n### v1.0.0 (08-04-2021):\n\n- Include Python 3.6, not only greater than.\n- Add DeepSource code checker and resolve found issue (related to shell=true)\n- Add aliases for command-line next to az-switch: + az-account-switch + az-account-switcher _(the package name)_\n- Dump to v1.0.0, since it's working fine for a while and looks better!\n\n### v0.0.6 (25-03-2021):\n\nAdd support for disabled subscriptions.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utility to switch Azure subscriptions",
"version": "1.4.0",
"project_urls": {
"Homepage": "https://github.com/abij/az-account-switcher",
"Repository": "https://github.com/abij/az-account-switcher"
},
"split_keywords": [
"azure",
"cli",
"subscription",
"management"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12ade43eb1cc5fdc589bb184fa906fe2303afc20fca4f7d82ac90a25d4fef49c",
"md5": "e20ab7011a60c146fc90180e668210ef",
"sha256": "84d4ebbbd0dbb548c477cf202c817ac985f338cc5e1f39e8c14bdd3c11ad6232"
},
"downloads": -1,
"filename": "az_account_switcher-1.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e20ab7011a60c146fc90180e668210ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 6628,
"upload_time": "2023-12-28T13:50:01",
"upload_time_iso_8601": "2023-12-28T13:50:01.568283Z",
"url": "https://files.pythonhosted.org/packages/12/ad/e43eb1cc5fdc589bb184fa906fe2303afc20fca4f7d82ac90a25d4fef49c/az_account_switcher-1.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "15189040393cc68fc0ce0cf5752601430f3829d9d52da69e2aa317e7cfebf931",
"md5": "abd6535d3a8083c0636c908a894b9b6a",
"sha256": "ab48880df95e66a3f32ff0b46c0423123ef9880c0528fc4a3283d3c1c6e5f01e"
},
"downloads": -1,
"filename": "az_account_switcher-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "abd6535d3a8083c0636c908a894b9b6a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5398,
"upload_time": "2023-12-28T13:50:04",
"upload_time_iso_8601": "2023-12-28T13:50:04.087033Z",
"url": "https://files.pythonhosted.org/packages/15/18/9040393cc68fc0ce0cf5752601430f3829d9d52da69e2aa317e7cfebf931/az_account_switcher-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-28 13:50:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "abij",
"github_project": "az-account-switcher",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "az-account-switcher"
}