Microsoft Azure Client Libraries for Python meta-package providing comprehensive access to Azure cloud services and management capabilities
npx @tessl/cli install tessl/pypi-azure@4.0.0A comprehensive meta-package providing access to Microsoft Azure cloud services and management capabilities for Python applications. This package serves as a convenience bundle that installs a curated set of individual Azure service libraries, enabling developers to access compute, networking, databases, AI services, and management operations through a unified SDK.
Note: This meta-package includes dependencies on Azure Storage packages (azure-storage-blob, azure-storage-queue, azure-storage-file, azure-cosmosdb-table, azure-datalake-store) that are distributed separately and not included in this repository.
pip install azure# Import specific service clients as needed
from azure.batch import BatchServiceClient
from azure.keyvault import KeyVaultClient
from azure.servicebus import ServiceBusService
from azure.mgmt.compute import ComputeManagementClientCommon namespace imports:
import azure.batch
import azure.keyvault
import azure.mgmt.compute# Example: Working with Azure Batch
from azure.batch import BatchServiceClient
from azure.batch.batch_auth import SharedKeyCredentials
# Set up authentication
credentials = SharedKeyCredentials(account_name, account_key)
batch_client = BatchServiceClient(credentials, base_url=batch_url)
# List pools
pools = batch_client.pool.list()
for pool in pools:
print(f"Pool ID: {pool.id}")
# Example: Working with Key Vault
from azure.keyvault import KeyVaultClient
from azure.keyvault.authentication import KeyVaultAuthentication
# Set up authentication
def auth_callback(server, resource, scope):
# Implement authentication logic
return access_token
credentials = KeyVaultAuthentication(auth_callback)
client = KeyVaultClient(credentials)
# Get a secret
secret = client.get_secret("https://vault.vault.azure.net/", "secret-name", "")
print(f"Secret value: {secret.value}")
# Example: Working with Management Services
from azure.mgmt.compute import ComputeManagementClient
from azure.common.credentials import ServicePrincipalCredentials
# Set up authentication
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
tenant=tenant_id
)
# Create management client
compute_client = ComputeManagementClient(credentials, subscription_id)
# List virtual machines
vms = compute_client.virtual_machines.list_all()
for vm in vms:
print(f"VM: {vm.name}")The Azure SDK for Python follows a modular architecture with three main layers:
Each service provides:
Batch computing, container services, and compute resource management capabilities.
class BatchServiceClient:
def __init__(self, credentials, base_url=None, **kwargs): ...
class ComputeManagementClient:
def __init__(self, credentials, subscription_id, **kwargs): ...Key management, secret storage, and identity/access management services.
class KeyVaultClient:
def __init__(self, credentials, **kwargs): ...
class GraphRbacManagementClient:
def __init__(self, credentials, tenant_id, **kwargs): ...Service Bus messaging, Event Grid event handling, and integration services.
class ServiceBusService:
def __init__(self, account_name=None, account_key=None, **kwargs): ...
class EventGridClient:
def __init__(self, credentials, **kwargs): ...Application insights, log analytics, and monitoring capabilities.
class ApplicationInsightsDataClient:
def __init__(self, credentials, **kwargs): ...
class LogAnalyticsDataClient:
def __init__(self, credentials, **kwargs): ...Service Fabric orchestration and legacy service management capabilities.
class ServiceFabricClientAPIs:
def __init__(self, **kwargs): ...
class ServiceManagementService:
def __init__(self, subscription_id, certificate_path, **kwargs): ...Comprehensive Azure resource management across all service categories including compute, storage, networking, databases, and more.
# Core resource management
class ResourceManagementClient:
def __init__(self, credentials, subscription_id, **kwargs): ...
# Storage management
class StorageManagementClient:
def __init__(self, credentials, subscription_id, **kwargs): ...
# Network management
class NetworkManagementClient:
def __init__(self, credentials, subscription_id, **kwargs): ...The Azure SDK supports multiple authentication methods:
# Shared key authentication (for services like Batch)
class SharedKeyCredentials:
def __init__(self, account_name: str, account_key: str): ...
# Service principal authentication (for management operations)
class ServicePrincipalCredentials:
def __init__(self, client_id: str, secret: str, tenant: str): ...
# Key Vault specific authentication
class KeyVaultAuthentication:
def __init__(self, authorization_callback: callable): ...
# Access token for Key Vault authentication callbacks
class AccessToken:
def __init__(self, token: str): ...
token: str # Bearer token value# Configuration and options
class Configuration:
def __init__(self, **kwargs): ...
# Common model base class
class Model:
def __init__(self, **kwargs): ...
# Paging and iteration
class Paged:
def __iter__(self): ...
def __next__(self): ...
# Error types
class CloudException(Exception):
def __init__(self, message: str, response=None): ...
class ClientRequestError(Exception):
def __init__(self, message: str): ...