or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

compute-services.mdindex.mdmessaging-integration.mdmonitoring-analytics.mdplatform-services.mdresource-management.mdsecurity-identity.md
tile.json

tessl/pypi-azure

Microsoft Azure Client Libraries for Python meta-package providing comprehensive access to Azure cloud services and management capabilities

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure@4.0.x

To install, run

npx @tessl/cli install tessl/pypi-azure@4.0.0

index.mddocs/

Azure SDK for Python

A 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.

Package Information

  • Package Name: azure
  • Language: Python
  • Installation: pip install azure
  • Version: 4.0.0
  • License: MIT

Core Imports

# 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 ComputeManagementClient

Common namespace imports:

import azure.batch
import azure.keyvault
import azure.mgmt.compute

Basic Usage

# 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}")

Architecture

The Azure SDK for Python follows a modular architecture with three main layers:

  • Service Clients: High-level clients for specific Azure services (Batch, Key Vault, Service Bus, etc.)
  • Management Clients: Resource management clients for provisioning and configuring Azure resources
  • Common Libraries: Shared authentication, error handling, and utility components

Each service provides:

  • Client Classes: Main entry points for service operations
  • Models: Data transfer objects representing Azure resources and request/response structures
  • Operations: Grouped service operations (often auto-generated from Azure REST APIs)
  • Authentication: Service-specific authentication helpers and credential management

Capabilities

Compute Services

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): ...

Compute Services

Security and Identity

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): ...

Security and Identity

Messaging and Integration

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): ...

Messaging and Integration

Monitoring and Analytics

Application insights, log analytics, and monitoring capabilities.

class ApplicationInsightsDataClient:
    def __init__(self, credentials, **kwargs): ...

class LogAnalyticsDataClient:
    def __init__(self, credentials, **kwargs): ...

Monitoring and Analytics

Platform Services

Service Fabric orchestration and legacy service management capabilities.

class ServiceFabricClientAPIs:
    def __init__(self, **kwargs): ...

class ServiceManagementService:
    def __init__(self, subscription_id, certificate_path, **kwargs): ...

Platform Services

Resource Management

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): ...

Resource Management

Authentication Patterns

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

Common Types

# 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): ...