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.1.0.tar.gz (7.1 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.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyzurecli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 280c1dea858beb2ddcaf7ed04e3cf712b1b7db84caf34b2aef5c0af1d11e16b2
MD5 0013892c483f183bb8089f3f64824edc
BLAKE2b-256 5c4126e5e3459686b68e43b1e5cb6cfca8ff2a0e3db0cc6eb714d6b7918aaac8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyzurecli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94dd499fc371a0f9a05c3c8baf181762a9c0ab5e4ef2e841b70d18f640f1804c
MD5 63c91866cac1da618b39f292509ce866
BLAKE2b-256 fa4ab36ddc2c8a827b460a8ca937966c61f61ab64c2eda9e5142b52c50b0c60c

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