Skip to main content

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 src.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.7.tar.gz (67.9 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.7-py3-none-any.whl (378.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyzurecli-0.7.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for pyzurecli-0.7.tar.gz
Algorithm Hash digest
SHA256 c50dc9262f90f6af5912a9a688db1785c42968c1fe74493c3cd56e17b8a1086f
MD5 d08e2b10a1f0c98b50069a7aec2cf0ff
BLAKE2b-256 170a1b5c75044a3c84336d5423e6e4edacee8c8b4bd6f6874be09d01f39db6a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyzurecli-0.7-py3-none-any.whl
  • Upload date:
  • Size: 378.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for pyzurecli-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6b9147d45e1293f4a82bf9cd364e1c15e17dbc12423bcabc9ad6028c408f6ca6
MD5 da8b490e10fefacea556860d0a3ca687
BLAKE2b-256 afdba006be85d946651e3c468e4fe2934c982392175f67880476ebcd992d9882

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