The Azure CDN Management Client Library for Python provides programmatic access to manage Azure Content Delivery Network (CDN) resources. It allows users to create, configure, update, and delete CDN profiles, endpoints, and custom domains. Part of the broader Azure SDK for Python, it follows the SDK's consistent design principles and release cadence, typically receiving updates as new Azure API versions are released or significant changes occur in the underlying service, often with minor version bumps and major version updates for breaking changes.
pip install azure-mgmt-cdnVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list existing CDN profiles in your subscription. Ensure the `AZURE_SUBSCRIPTION_ID` environment variable is set. It highlights the typical pattern for creating the client and iterating over paginated results.
Update authentication code to use `azure.identity.DefaultAzureCredential` or other `azure-identity` credentials. Review the official changelog for specific API changes to resource models and operations.
Always call `.result()` on the `begin_` method's return value for long-running operations: `poller = client.profiles.begin_create(...); created_profile = poller.result()`.
Iterate directly over the returned object (e.g., `for profile in client.profiles.list():`) or convert it explicitly to a list if all results are needed at once (e.g., `list(client.profiles.list())`).
For troubleshooting, enable logging for `azure.identity`. For explicit control, use specific credential classes like `EnvironmentCredential`, `ManagedIdentityCredential`, or `ServicePrincipalCredential` from `azure.identity`.
Ensure the `azure-identity` package is installed. You can install it directly via `pip install azure-identity` or verify it's included as a dependency when installing your specific Azure SDK client library.
Update your import statement to `from azure.mgmt.cdn import CdnManagementClient`.
Ensure you are logged into Azure CLI (`az login`), or set the necessary environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`). Alternatively, use a more specific credential type if `DefaultAzureCredential` is not suitable for your deployment environment.
Register the `Microsoft.Cdn` resource provider using the Azure CLI (`az provider register --namespace Microsoft.Cdn`), Azure PowerShell (`Register-AzResourceProvider -ProviderNamespace Microsoft.Cdn`), or through the Azure portal by navigating to Subscriptions -> Resource Providers and registering 'Microsoft.Cdn'.
Contact Azure Support to request an increase in your subscription's quota for CDN profiles or the specific CDN resource you are trying to create. Provide your subscription ID and the requested quota limit.