Azure Legacy Service Management Client Library

0.20.8 · deprecated · verified Sat Apr 11

This library provides programmatic access to the older Azure Service Management (ASM) APIs for Python. It is now deprecated and has been superseded by the Azure Resource Manager (ARM) APIs, which offer a more robust and feature-rich way to manage Azure resources. The last version is 0.20.8, released on Oct 31, 2024, and it will only receive security fixes until this date, with no further maintenance or new features.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `ServiceManagementService` client. It explicitly warns against using this deprecated library for new development and highlights the need to migrate to modern Azure Resource Manager (ARM) SDKs and `azure-identity` for authentication. A fully runnable example for this legacy library is intentionally omitted due to its deprecated status and complex, older authentication mechanism (management certificates).

from azure.servicemanagement import ServiceManagementService
import os

# WARNING: This library is DEPRECATED and not recommended for new projects.
# It uses the old Azure Service Management (ASM) APIs, which have been retired
# and no longer receive feature updates or non-security bug fixes after Oct 31, 2024.
# New development should use the modern Azure Resource Manager (ARM) SDKs
# (e.g., azure-mgmt-compute, azure-mgmt-network, azure-mgmt-storage) and 'azure-identity' for authentication.
# This example is purely illustrative and not recommended for active use.

try:
    subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
    # Connecting to ASM typically requires a management certificate (.pem file).
    # For a quickstart, providing a runnable example with certificates is cumbersome and misleading
    # given the library's deprecated status. The primary intent is to show the import
    # and strongly advise against its use.
    # For historical context, an instantiation might look like:
    # cert_file_path = os.environ.get('AZURE_MANAGEMENT_CERT_PATH', '/path/to/your/management_cert.pem')
    # service_client = ServiceManagementService(subscription_id, cert_file_path)

    print("The 'azure-servicemanagement-legacy' library is deprecated.")
    print("Migrate to Azure Resource Manager (ARM) SDKs and 'azure-identity' for modern Azure management.")
except Exception as e:
    print(f"An error occurred (likely due to deprecated usage or missing credentials/certs): {e}")
    print("This is expected behavior for a deprecated library without proper legacy setup.")

view raw JSON →