Registry /
azure / azure-mgmt-resource-deploymentstacks
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.614s · 44.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.562s · 45MB
43MB installed
● package 43MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DeploymentStacksClient
✓ from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient
✗ from azure.mgmt.resource import DeploymentStacksClient
The Deployment Stacks client was previously part of `azure-mgmt-resource`. In version 24.0.0+, it was split into its own dedicated package, requiring the fully qualified import path to avoid an `ImportError`.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all Deployment Stacks within a specified Azure subscription.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient
# Set environment variables for authentication:
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET for Service Principal/OAuth
# AZURE_SUBSCRIPTION_ID for the target subscription
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "")
if not subscription_id:
print("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
exit(1)
# Authenticate using DefaultAzureCredential, which attempts various methods
# (e.g., environment variables, managed identity, Azure CLI).
credential = DefaultAzureCredential()
# Create a Deployment Stacks client
client = DeploymentStacksClient(credential=credential, subscription_id=subscription_id)
# Example: List all deployment stacks in the current subscription
print(f"Listing deployment stacks for subscription: {subscription_id}")
try:
for stack in client.deployment_stacks.list_at_subscription_scope():
print(f"- Name: {stack.name}, Resource Group: {stack.resource_group}")
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure your credentials have 'Microsoft.Resources/deploymentStacks/read' permission.")
print("\nQuickstart finished.")
Debug
Known issues
breakingThe functionality for Deployment Stacks was moved from `azure-mgmt-resource` to its own dedicated package, `azure-mgmt-resource-deploymentstacks`, starting with `azure-mgmt-resource` version 24.0.0. This requires updating import statements.fixUpdate your import statement from `from azure.mgmt.resource import DeploymentStacksClient` to `from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient`.
affects: azure-mgmt-resource < 24.0.0
breakingThis package, like other new Azure SDK management libraries, now exclusively targets the *latest* API-Version available on Azure. Older API versions are no longer supported directly within this package.fixIf your application relies on a specific, non-latest API-Version, you must pin your package dependency to an older, compatible version that supported that API-Version. Otherwise, ensure your code is compatible with the latest API schemas.
affects: All versions >= 1.0.0
breakingThe credential system has been completely revamped. Legacy `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported for authentication.fixMigrate your authentication code to use classes from the `azure-identity` library (e.g., `DefaultAzureCredential`, `ClientSecretCredential`).
affects: All versions >= 1.0.0
deprecatedAzure Deployment Stacks are the successor to Azure Blueprints. Azure Blueprints will be deprecated by July 2026, and customers are advised to migrate their blueprint definitions and assignments to Template Specs and Deployment Stacks.fixPlan to migrate existing Azure Blueprint definitions and assignments to use Azure Template Specs in conjunction with Deployment Stacks before July 2026.
affects: N/A (relates to Azure service, not library version)
gotchaAzure SDK Python packages ended support for Python 2.7 on January 1, 2022.fixEnsure your project uses Python 3.9 or higher, as required by this library.
affects: < 1.0.0 (and all newer versions)
Upgrade
Version history
1.0.0latest on PyPI · released Feb 10, 2026
Audit
Dependencies
azure-identityrequiredRequired for Azure Active Directory token authentication methods, such as DefaultAzureCredential.