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.2.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.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyzurecli-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 606b826a37b097fcb29060ea2d216138dbf6ae8b62b37e984465e82303ec5e0b
MD5 ba463a9f2b4eac363cf9ef5f05ecf3e5
BLAKE2b-256 8d8bd37f31d275c167971b69b2b244a18ab762328674e663ad765b1cdd2f2d7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyzurecli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c482933ee2055c019209ae5adf7a675ae191eee66531a84660521c8c3b326ec
MD5 38c8863c1c595cc1a9f2742ff545ce68
BLAKE2b-256 934d18e8d460cf8f79d18f3aa5f41171e23cf7fac34a5f45c7e7a396a5664882

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