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.1.tar.gz (7.6 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.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyzurecli-0.6.1.tar.gz
  • Upload date:
  • Size: 7.6 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.1.tar.gz
Algorithm Hash digest
SHA256 12e33c2b89cb4c016eeb38b3881950b8ad2e4180087dde6c23bd821b2341dd77
MD5 b3bd6fe4299e7202ceb9593ba02dba7e
BLAKE2b-256 765ab13dbee48b9d3f32c55e02af83a5f9ae21a52db917370b5a906faa952519

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyzurecli-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3d7f534be1502575ea8bd9652d16b8fbfb6340e0c870d02dbad3b76497bfe69
MD5 17829dcb2dd618ef63785f0b9ed6b60c
BLAKE2b-256 6d85bb5bc4abf30bcb737dfc37aae82bce147bd0a5daba6644205b459d6bc46b

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