Skip to main content

Async Azure CLI automation via Docker-based isolation

Project description

PyzureCLI

Asynchronous Azure CLI automation via Docker-based isolation.

PyzureCLI runs every az command inside a disposable Docker container, providing:

  • Interactive login (device-code flow) with persistent session cache at ./azure/user
  • Service principal creation and managed login, cached under ./azure/sp
  • App registration for multi-tenant OAuth flows, configured in ./azure/app_registration
import asyncio
from pathlib import Path
from pyzurecli import az

async def main():
    # Initialize AzureCLI client (entry via factory.py)
    cli = await az.__async_init__(Path.cwd())

    # Inspect current subscription metadata
    meta = await cli.metadata
    print("Subscription ID:", meta.subscription_id)

    # Create or retrieve a Service Principal
    sp = await cli.service_principal
    print("SP App ID:", sp.creds.appId)

    # Create or retrieve an App Registration
    ar = await cli.app_registration
    client_id = await ar.client_id
    print("App Registration Client ID:", client_id)

    # Generate an admin-consent URL
    url = await ar.generate_admin_consent_url()
    print("Consent URL:", url)

asyncio.run(main())

License

MIT © genderlesspit

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

pyzurecli-0.6.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzurecli-0.6.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pyzurecli-0.6.0.tar.gz.

File metadata

  • Download URL: pyzurecli-0.6.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pyzurecli-0.6.0.tar.gz
Algorithm Hash digest
SHA256 5bbba6e5042ae59afc4db215d764180e309f36cc11fadfe7b55e4c45a8aa8ca8
MD5 d3e3ea62df6b9beda971df13faa5a214
BLAKE2b-256 e5ac78d8841bc4cbf3ca95c3f58c9fb2e57d1c742ee2e88fe9a83912dc192792

See more details on using hashes here.

File details

Details for the file pyzurecli-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: pyzurecli-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pyzurecli-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b8464d11d1fa451e15d2c657a8165ca61c15b073c03c2290c169309ecb1e26a
MD5 3f17d9bdb69f701798f1dc5994e4a336
BLAKE2b-256 93d6019bbc4a1e264eaec427b6ea0b12ab5dde739db6ced3c116bf0dabc866da

See more details on using hashes here.

Supported by

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