{"id":1936,"library":"azure-mgmt-resource-deploymentstacks","title":"Azure Deployment Stacks Management","description":"The `azure-mgmt-resource-deploymentstacks` library is the Microsoft Azure Resource Deployment Stacks Management Client Library for Python (version 1.0.0). It provides programmatic access to manage Azure Deployment Stacks, a native Azure resource type designed for managing collections of Azure resources as a single unit across different management scopes. This package is part of the broader Azure SDK for Python and supports Python 3.9+.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/","tags":["azure","management","deployment","arm","resource","iac"],"install":[{"cmd":"pip install azure-mgmt-resource-deploymentstacks azure-identity","lang":"bash","label":"Install core package and authentication library"}],"dependencies":[{"reason":"Required for Azure Active Directory token authentication methods, such as DefaultAzureCredential.","package":"azure-identity","optional":false}],"imports":[{"note":"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`.","wrong":"from azure.mgmt.resource import DeploymentStacksClient","symbol":"DeploymentStacksClient","correct":"from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.resource.deploymentstacks import DeploymentStacksClient\n\n# Set environment variables for authentication:\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET for Service Principal/OAuth\n# AZURE_SUBSCRIPTION_ID for the target subscription\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\")\n\nif not subscription_id:\n    print(\"Please set the AZURE_SUBSCRIPTION_ID environment variable.\")\n    exit(1)\n\n# Authenticate using DefaultAzureCredential, which attempts various methods\n# (e.g., environment variables, managed identity, Azure CLI).\ncredential = DefaultAzureCredential()\n\n# Create a Deployment Stacks client\nclient = DeploymentStacksClient(credential=credential, subscription_id=subscription_id)\n\n# Example: List all deployment stacks in the current subscription\nprint(f\"Listing deployment stacks for subscription: {subscription_id}\")\n\ntry:\n    for stack in client.deployment_stacks.list_at_subscription_scope():\n        print(f\"- Name: {stack.name}, Resource Group: {stack.resource_group}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure your credentials have 'Microsoft.Resources/deploymentStacks/read' permission.\")\n\nprint(\"\\nQuickstart finished.\")","lang":"python","description":"This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then list all Deployment Stacks within a specified Azure subscription."},"warnings":[{"fix":"Update your import statement from `from azure.mgmt.resource import DeploymentStacksClient` to `from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient`.","message":"The 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.","severity":"breaking","affected_versions":"azure-mgmt-resource < 24.0.0"},{"fix":"If 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.","message":"This 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.","severity":"breaking","affected_versions":"All versions >= 1.0.0"},{"fix":"Migrate your authentication code to use classes from the `azure-identity` library (e.g., `DefaultAzureCredential`, `ClientSecretCredential`).","message":"The credential system has been completely revamped. Legacy `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported for authentication.","severity":"breaking","affected_versions":"All versions >= 1.0.0"},{"fix":"Plan to migrate existing Azure Blueprint definitions and assignments to use Azure Template Specs in conjunction with Deployment Stacks before July 2026.","message":"Azure 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.","severity":"deprecated","affected_versions":"N/A (relates to Azure service, not library version)"},{"fix":"Ensure your project uses Python 3.9 or higher, as required by this library.","message":"Azure SDK Python packages ended support for Python 2.7 on January 1, 2022.","severity":"gotcha","affected_versions":"< 1.0.0 (and all newer versions)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}