M365Con 2027 – free online conference · 11–22 Jan 2027 · 120 sessions m365con.net

Azure deployment stacks

Product

A deployment stack is an Azure resource that manages a group of resources defined in a Bicep or ARM template as one unit, tracking what it owns and deleting or detaching resources removed from the template; deny settings can block changes outside the stack.

◆ PRODUCTAzure deployment stacksM365.FM
Title graphic: Azure deployment stacks (Product)

Relationships

Azure deployment stacks is a product and part of Microsoft Azure.

Description

A deployment stack is an Azure resource that manages a group of resources as one unit. The group is defined by a Bicep file or an ARM JSON template, and the stack keeps track of which resources it owns. The feature is part of Microsoft Azure and is documented under Azure Resource Manager. Its purpose is lifecycle management: instead of treating a template deployment as a one-off action, the stack remembers what was deployed and can act on the difference when the template changes.

A stack can be created at resource group, subscription or management group scope, which allows resources spread across several scopes to be handled together. When a resource is removed from the template and the stack is updated, the setting for unmanaged resources decides what happens to it. By default the resource is detached, meaning it stays in Azure but is no longer managed by the stack. Alternatively, unmanaged resources can be deleted, either as resources only or as a whole including resource groups. Because these delete flags are applied in a single update, stacks can also be used to clean up an environment in one operation.

Protection against unwanted changes is handled through deny settings. These can be set to none, deny delete, or deny write and delete. They can apply to child scopes and can allow excluded actions as well as up to five excluded Microsoft Entra principals. Deny settings only affect control plane operations, not data plane ones, and they only cover resources that are explicitly defined in the template, not implicitly created ones such as the virtual machines of an Azure Kubernetes Service cluster. Teams that rely on deny settings should keep this scope in mind.

Access to stacks is governed by Azure RBAC. The built-in roles are Azure Deployment Stack Contributor and Azure Deployment Stack Owner. The resources managed by a stack can be exported as JSON. In the Azure portal there is no graphical view of the managed resources, so PowerShell or the Azure CLI is needed to work with them, with Azure PowerShell 12.0.0 or Azure CLI 2.61.0 as the minimum versions according to the documentation.

Typical decisions around deployment stacks include which scope the stack should live at, whether removed resources should be detached or deleted, and which deny setting fits the environment. A detach default is the more conservative choice, while delete options suit short-lived or test environments that should be removed completely. Deny settings fit shared or production environments where changes made outside the template should be prevented, with excluded principals reserved for cases that need an exception.

The M365.FM episode "Design Reliable and Resilient Azure Architectures" mentions deployment stacks in the context of infrastructure as code. It lists using Azure Deployment Stacks among practices such as CI/CD pipelines, Azure Policy to enforce standards, and regular audits and drift detection. The episode says that stacks let teams create repeatable resource definitions for their infrastructure, and that these practices keep infrastructure predictable and reduce hidden risks to Azure solutions. Deployment stacks therefore sit alongside Bicep and ARM templates as a way to keep deployed resources consistent with their definitions over time.

Overview compiled with AI from M365.FM episodes and the facts on this page. You can improve it with the edit button below.

TypeProduct
DocumentationAzure deployment stacks – Microsoft Learn learn.microsoft.com

Frequently asked questions

Questions marked with AI were written with AI from the facts on this page.

What happens to resources that are removed from the template of a deployment stack? (AI)

It depends on the unmanaged resources setting. By default they are detached and remain in Azure, but the stack can also be configured to delete them, either as resources or as a whole including resource groups.

What do deny settings in a deployment stack do? (AI)

They block changes to managed resources outside the stack. The options are none, deny delete, and deny write and delete, with excluded actions and up to five excluded Entra principals possible. They only affect control plane operations and explicitly defined resources.

At which scopes can a deployment stack be created? (AI)

Deployment stacks can be created at resource group, subscription or management group scope.

Related topics in brief

Topics linked to Azure deployment stacks, each briefly explained:

All relationships of Azure deployment stacks, grouped by type of relationship:

Part of

Offerings of which Azure deployment stacks is a part:

Glossary

Community wiki

Short info above, community knowledge below: add practical tips, examples or corrections. New contributions are reviewed first; trusted members publish directly.

Experts and companies for this topic

Nobody has listed this topic yet. Add it to your profile.

Experts on related topics

Experts on topics related to Azure deployment stacks, each with the topic that connects them:

Sources

Maintained by Mirko Peters (Microsoft MVP) · Last updated: