Azure Resource Manager
Azure Resource Manager is the control plane for all Azure resources — every portal click, CLI command, Bicep deployment, and SDK call goes through ARM, which enforces identity, policy, and governance before any resource is touched.
Overview
ARM provides a consistent management layer across all Azure services. It organises resources into a hierarchy — management groups, subscriptions, resource groups, and individual resources — and applies access control, policy, tags, and locks at any level of that hierarchy. Understanding ARM is fundamental to architect-level Azure work because governance decisions made at the ARM layer affect every team and every workload in a tenant. Deployment modes, resource providers, the management plane versus data plane distinction, and the ARM REST API underpin every IaC tool including Bicep, Terraform, and Pulumi.
What you will learn
- Explain ARM hierarchy, scopes, control-plane routing, resource providers, and API versions.
- Distinguish management-plane and data-plane identity and authorization.
- Author and interpret native ARM templates, parameters, functions, dependencies, and outputs.
- Apply RBAC, Policy, locks, tags, and deployment ownership safely.
- Preview, deploy, monitor, and troubleshoot resource operations.
- Choose Bicep, Terraform, native templates, SDKs, or the portal based on lifecycle needs.
Prerequisites
- Azure tenant, subscription, resource group, Entra ID, and RBAC fundamentals.
- Basic JSON and declarative deployment experience.
- Azure CLI access for optional what-if and deployment exercises.
When to use Azure Resource Manager
Good fit
- You need to understand or integrate directly with Azure's native control plane.
- A generated or vendor-supplied ARM template must be reviewed, secured, or operated.
- A resource feature is available through ARM before a higher-level tool supports it.
Choose another approach when
- Hand-authoring large JSON templates when Bicep provides equivalent typed coverage.
- Using management-plane automation for high-volume service data operations.
- Bypassing established platform modules, governance, or deployment ownership without a clear reason.
Key concepts
Resources live in resource groups, resource groups live in subscriptions, and subscriptions live in management groups. Policies and RBAC assignments at a higher scope inherit down, enabling consistent governance across all workloads.
Azure RBAC controls who can perform which actions on which resources using built-in and custom role definitions assigned to users, groups, service principals, or managed identities at any scope in the hierarchy.
Policies define rules that ARM evaluates on every resource write — preventing non-compliant resources from being created, auditing existing ones, or automatically remediating drift from the desired configuration baseline.
Incremental mode adds or updates resources without touching others in the group; complete mode deletes any resource not in the template. Resource locks — CanNotDelete and ReadOnly — prevent accidental or unauthorised changes outside the deployment pipeline.
Each Azure service registers resource types and versioned control-plane schemas that define supported properties, operations, regions, and behavior.
ARM templates create deployment records whose nested operations expose validation, dependency, policy, and provider failures.
What-if previews proposed changes while deployment stacks add explicit ownership and controlled handling of resources removed from the declaration.
ARM controls resource lifecycle and configuration, while service-specific data APIs have separate permissions, endpoints, and operational risks.
Architecture
Every Azure operation — portal, CLI, SDK, or IaC — passes through the ARM API, which authenticates via Entra ID, evaluates RBAC and Policy, and routes to the target resource provider.
Conceptual architecture · Adapt to your system context
Implementation walkthrough
The ARM Secure Storage sample is a strict native JSON deployment with deterministic naming, validated inputs, tag merging, HTTPS and TLS controls, OAuth-first access, deny-by-default networking, encryption, recovery, lifecycle policy, and an executable template inspector.
- 01Select deployment scope
Choose tenant, management group, subscription, or resource group scope and understand inherited RBAC and Policy.
- 02Choose resource APIs
Select supported resource types and API versions whose schemas expose the needed properties in target regions.
- 03Define parameters and variables
Validate environment inputs, document contracts, calculate deterministic names, and merge mandatory governance tags.
- 04Declare secure resources
Use explicit identities, network defaults, encryption, diagnostics, recovery, and service-specific security properties.
- 05Express dependencies
Use resourceId, reference, and dependsOn only where operation order genuinely requires it.
- 06Validate and preview
Parse strict JSON, validate the template, run policy checks, and review what-if at the intended scope.
- 07Deploy and observe
Use a least-privilege identity, stable deployment naming, operation logs, correlation IDs, and post-deployment tests.
- 08Govern lifecycle
Use Policy, locks, deployment stacks, Resource Graph, activity logs, and explicit removal procedures to manage change.
Code example
The Azure SDK for .NET manages ARM-level resources — creating resource groups, assigning roles, and applying locks — directly in code for automation pipelines or custom governance tooling.
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
var credential = new DefaultAzureCredential();
var armClient = new ArmClient(credential);
var subscription = await armClient
.GetDefaultSubscriptionAsync();
// Create a resource group with required tags
var rgData = new ResourceGroupData(AzureLocation.UKSouth)
{
Tags =
{
["environment"] = "production",
["team"] = "platform",
["costCentre"] = "CC-1042"
}
};
var rg = await subscription.GetResourceGroups()
.CreateOrUpdateAsync(
WaitUntil.Completed,
"rg-orders-prod",
rgData);
Console.WriteLine($"Resource group ready: {rg.Value.Data.Name}");
// Apply a CanNotDelete lock to protect production resources
var lockData = new ManagementLockData(ManagementLockLevel.CanNotDelete)
{
Notes = "Production resource group — deletion requires CAB approval"
};
await rg.Value.GetManagementLocks()
.CreateOrUpdateAsync(
WaitUntil.Completed,
"lock-orders-prod",
lockData);
Console.WriteLine("Resource lock applied.");Testing strategy
Test JSON structure, ARM expression contracts, control-plane changes, governance, and the resulting service behavior.
- Parse templates and parameter files as strict JSON.
- Run ARM validation and template-toolkit policy checks.
- Inspect what-if for create, update, replace, delete, role, and network effects.
- Deploy to an isolated resource group under representative Policy.
- Verify data-plane access through the intended managed identity.
- Test stack removal, locks, policy denial, rollback, and disaster recovery.
Security considerations
ARM is the enforcement path for management operations, but each service retains separate data-plane controls.
- Use workload identity and narrow deployment roles at the smallest practical scope.
- Use managed identity and data roles instead of shared keys.
- Apply Policy for non-negotiable locations, SKUs, tags, identity, diagnostics, and network controls.
- Keep secrets out of parameters, outputs, tags, deployment names, and operation logs.
- Use deny-by-default networking and private endpoints where required.
- Protect stateful production resources with deliberate locks and removal approvals.
Performance and scalability
ARM deployments are asynchronous control-plane workflows constrained by provider latency and throttling.
- Express accurate dependencies so independent resources deploy in parallel.
- Avoid serial dependsOn chains that do not represent real requirements.
- Split unrelated resources into sensible deployment boundaries.
- Respect subscription and provider throttling with bounded retries.
- Use Resource Graph for cross-subscription inventory instead of serial ARM reads.
- Track deployment duration and slow nested operations.
Deployment and operations
Treat every ARM deployment as an authenticated, policy-evaluated, auditable control-plane transaction.
- Validate syntax and policy before protected credentials are available.
- Run what-if and require review for destructive or privilege-sensitive changes.
- Deploy through short-lived identity with environment concurrency controls.
- Retain deployment and nested operation records.
- Use incremental deployments and stacks for explicit removal ownership.
- Run post-deployment management-plane and data-plane checks.
Common problems and fixes
Deployment reports InvalidTemplate.
Likely cause: JSON, expression, parameter, dependency, scope, or API schema is invalid.
Fix: Validate locally, inspect the exact nested error target, and compare the resource with its API-version schema.
AuthorizationFailed appears for one resource.
Likely cause: The identity lacks a required action at that resource or parent scope.
Fix: Use the failed action and scope to select the narrowest role and allow role propagation before retrying.
RequestDisallowedByPolicy blocks deployment.
Likely cause: An inherited policy denies the proposed resource state.
Fix: Inspect policy evaluation details and remediate the template; use exemptions only through governed approval.
A dependent resource cannot find its parent.
Likely cause: The reference or dependsOn relationship is missing or uses the wrong resource ID.
Fix: Construct the ID at the correct scope and express the actual dependency.
What-if predicts recurring changes.
Likely cause: The provider returns defaults or runtime values differently from the declaration.
Fix: Specify stable supported values, inspect provider behavior, and document narrowly justified noise.
Deployment succeeded but the app cannot access data.
Likely cause: Management deployment worked while data-plane role, network, firewall, or DNS access did not.
Fix: Test identity token, data role, private endpoint, DNS, and service firewall as a separate data-plane path.
Best practices
- Design the management group and subscription hierarchy before deploying workloads — retrofitting governance scope after resources exist is significantly more complex and disruptive.
- Assign Azure roles at the narrowest practical scope—usually a subscription or resource group—and reserve management-group assignments for genuinely shared platform responsibilities.
- Use Azure Policy deny effects for non-negotiable standards — allowed locations, required tags, SKU restrictions — and audit effects for visibility before escalating to deny.
- Apply CanNotDelete locks to production resource groups containing stateful resources so accidental complete-mode deployments or manual deletions require an explicit lock removal step.
- Use managed identities and least-privilege roles for automation instead of long-lived owner credentials.
- Preview deployments, retain operation evidence, and use deployment stacks for explicit deletion ownership.
Production checklist
- Hierarchy, scope, ownership, and inheritance are documented.
- Resource types and API versions are supported and tested.
- Parameters are validated and secrets never enter deployment records.
- RBAC, Policy, locks, tags, and network controls are intentional.
- What-if and destructive-change review gate deployment.
- Deployment identity is short-lived and least privilege.
- Operations, correlation IDs, activity logs, and Resource Graph evidence are retained.
- Stack removal, lock recovery, provider failure, and data-plane access are rehearsed.
Common interview questions
What is the difference between the management plane and the data plane in Azure?
The management plane is the ARM API used to create, update, delete, and configure resources — all RBAC and Policy enforcement happens here. The data plane is the resource's own API for working with its content — reading blobs from Storage, sending messages to Service Bus, or querying a database. A user can have ARM RBAC rights to manage a resource without having data plane access to its content, and vice versa.
What is the difference between incremental and complete deployment mode?
Incremental mode, the recommended default, adds or updates resources in the template while leaving unspecified resources in place. Complete mode deletes resources that are absent from the template, but Microsoft is gradually deprecating it for deletion scenarios; use deployment stacks when a declarative deployment must also remove resources.
How would you enforce a tagging standard across all resources in an Azure tenant?
Assign an Azure Policy at the management group scope with a deny effect that requires specified tag keys on all resource writes. For existing untagged resources, use a modify policy with a remediation task to apply default tag values. This ensures compliance for new resources immediately and provides a path to remediate existing ones.
What is an Azure resource provider?
A resource provider implements ARM resource types and operations for a service, publishes API versions, and performs the control-plane work after ARM authorizes and validates a request.
How are Azure RBAC and Azure Policy different?
RBAC decides who may perform an action at a scope; Policy evaluates whether a resource state or requested change complies with organizational rules.
Why use deployment stacks?
Stacks record deployment ownership, can protect managed resources with deny assignments, and define what happens when a resource disappears from the declaration.
How do you troubleshoot a failed ARM deployment?
Start with the deployment and nested operation records, correlation ID, provider error details, activity log, policy evaluation, permissions, quota, and the exact API version and request.
Dedicated GitHub sample
Clone, run, test, and modify the focused implementation created for this guide.
ARM Secure Storage
A native ARM JSON deployment for secure Azure Storage with validated inputs, deterministic names, governance tags, OAuth-first authorization, deny-by-default networking, encryption, recovery, lifecycle policy, and strict template tests.
- Run
dotnet run --project tools/ArmTemplateInspector -- infra/azuredeploy.json- Test
dotnet test ArmSecureStorage.slnx