Home DevOps Microsoft Azure — Subscriptions & Resource Groups
Beginner 4 min · July 12, 2026

Microsoft Azure — Subscriptions & Resource Groups

Azure subscriptions, management groups, resource groups, tagging strategy, and organizational hierarchy..

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Everything here is grounded in real deployments.

Follow
Verified
production tested
July 12, 2026
last updated
436
articles · all by Naren
Before you start⏱ 20 min
  • Azure CLI (version 2.50+), an active Azure subscription with Owner or Contributor access, basic understanding of cloud computing concepts, and familiarity with command-line tools.
✦ Definition~90s read
What is Microsoft Azure?

Microsoft Azure — Subscriptions & Resource Groups is a core Azure service that handles subscriptions resource groups in the Microsoft cloud ecosystem.

Subscriptions & Resource Groups is like having a specialized tool that handles subscriptions resource groups in the Microsoft cloud — you manage the configuration, Azure handles the infrastructure.
Plain-English First

Subscriptions & Resource Groups is like having a specialized tool that handles subscriptions resource groups in the Microsoft cloud — you manage the configuration, Azure handles the infrastructure.

Azure is Microsoft's cloud computing platform offering over 200 services. This article covers subscriptions & resource groups with production-ready configurations, best practices, and hands-on examples.

Why Azure Subscriptions Matter

Azure Subscriptions are the fundamental billing and access control boundary in Microsoft Azure. Each subscription represents a logical container for resources, with its own limits, quotas, and policies. Think of a subscription as a sandbox: you can have multiple subscriptions for different environments (dev, test, prod), departments, or cost centers. Without proper subscription design, you risk cost overruns, security breaches, and management chaos. For example, a single subscription can host up to 980 resource groups per region, but hitting that limit unexpectedly can block deployments. Always plan your subscription hierarchy using management groups to enforce governance at scale.

list-subscriptions.shBASH
1
az account list --output table
Output
Name SubscriptionId State
Production 1234-5678-90ab-cdef Enabled
Development abcd-ef12-3456-7890 Enabled
⚠ Subscription Limits
Each subscription has hard limits: 980 resource groups per region, 25,000 VMs per region (default). Plan to create additional subscriptions before hitting these limits.
📊 Production Insight
In production, we once hit the 980 resource group limit during a large microservices rollout. We had to migrate services to a new subscription, causing downtime. Always monitor subscription usage and set alerts at 80% of limits.
🎯 Key Takeaway
Subscriptions are the top-level boundary for billing, access, and scale.
azure-subscriptions-resource-groups THECODEFORGE.IO Subscription and Resource Group Creation Workflow Step-by-step process for setting up Azure subscriptions and resource groups Define Subscription Purpose Identify environment type: dev, test, or production Create Azure Subscription Use Azure portal, CLI, or ARM template Assign RBAC Roles Grant Owner, Contributor, or Reader access Create Resource Groups Group resources by lifecycle or function Deploy Resources Add VMs, databases, or storage to groups Monitor and Manage Costs Set budgets and alerts per subscription ⚠ Avoid mixing production and test resources in one subscription Use separate subscriptions for isolation and cost tracking THECODEFORGE.IO
thecodeforge.io
Azure Subscriptions Resource Groups

Resource Groups: The Logical Container

Resource Groups are containers that hold related resources for an Azure solution. They share the same lifecycle, permissions, and policies. A resource group can contain resources from multiple regions, but it's best practice to colocate resources that share a common lifecycle. For example, a web app, its database, and storage account should be in the same resource group so you can deploy, update, and delete them together. Resource groups are not hierarchical; you cannot nest them. Each resource must belong to exactly one resource group, and moving resources between groups is possible but can cause downtime if not done carefully.

create-resource-group.shBASH
1
az group create --name prod-web-rg --location eastus
Output
{
"id": "/subscriptions/.../resourceGroups/prod-web-rg",
"location": "eastus",
"name": "prod-web-rg",
"properties": {
"provisioningState": "Succeeded"
}
}
💡Naming Convention
Use a consistent naming convention like <env>-<app>-<role>-rg (e.g., prod-web-rg). This makes it easy to identify resource groups in the portal and CLI.
📊 Production Insight
We once deleted a resource group thinking it only contained test resources, but it also held a shared storage account used by production. Always double-check resource group contents before deletion. Use resource locks to prevent accidental deletion.
🎯 Key Takeaway
Resource groups are the unit of management and lifecycle for Azure resources.

Subscription vs Resource Group: Hierarchy and Scope

Understanding the hierarchy is crucial: Management Group > Subscription > Resource Group > Resource. Subscriptions are the billing boundary, while resource groups are the management boundary. Policies and RBAC can be applied at any level, but they flow downward. For example, a policy applied at the subscription level affects all resource groups and resources within it. Resource groups cannot span subscriptions. When designing, consider that moving a resource between resource groups is allowed, but moving a resource group between subscriptions is not directly supported—you must move each resource individually. This has implications for reorganization and cost allocation.

move-resource.shBASH
1
2
az resource move --destination-group prod-db-rg \
  --ids /subscriptions/.../resourceGroups/prod-web-rg/providers/Microsoft.Sql/servers/mydb
Output
Resource move completed successfully.
🔥Resource Move Limitations
Some resource types cannot be moved (e.g., Azure AD, Key Vault with soft-delete enabled). Check documentation before planning moves.
📊 Production Insight
During a corporate reorganization, we needed to move a resource group to a different subscription. We had to script the move of each resource, which caused a weekend of downtime. Plan your subscription structure early to avoid this.
🎯 Key Takeaway
Subscriptions are for billing and isolation; resource groups are for lifecycle management.
azure-subscriptions-resource-groups THECODEFORGE.IO Azure Subscription and Resource Group Hierarchy Layered structure from management groups to resources Management Group Enterprise Root | Department A | Department B Subscription Production Sub | Development Sub | Test Sub Resource Group Network RG | Compute RG | Storage RG Resources Virtual Network | Virtual Machine | Blob Storage THECODEFORGE.IO
thecodeforge.io
Azure Subscriptions Resource Groups

Organizing Subscriptions for Production

For production workloads, use a hub-spoke subscription model. Create a 'connectivity' subscription for shared networking (VPN, ExpressRoute, firewall) and separate 'workload' subscriptions for each application or environment. This isolates blast radius: a misconfiguration in one workload doesn't affect others. Use Azure Policy to enforce tagging, region restrictions, and allowed SKUs across subscriptions. For example, require all resources to have a 'CostCenter' tag. This enables chargeback and cost analysis. Also, consider using Azure Blueprints to define a repeatable set of policies and resource groups for new subscriptions.

assign-policy.shBASH
1
2
3
4
az policy assignment create --name 'require-costcenter-tag' \
  --policy /providers/Microsoft.Authorization/policyDefinitions/... \
  --scope /subscriptions/1234-5678-90ab-cdef \
  --params '{"tagName":{"value":"CostCenter"}}'
Output
{
"id": "/subscriptions/.../providers/Microsoft.Authorization/policyAssignments/...",
"name": "require-costcenter-tag",
"type": "Microsoft.Authorization/policyAssignments"
}
💡Management Groups
Use management groups to organize subscriptions. For example, create a 'Production' management group with policies that enforce stricter controls than 'Development'.
📊 Production Insight
We once had a developer accidentally create a costly GPU VM in the production subscription because there was no policy restricting VM SKUs. Now we enforce allowed SKUs at the management group level.
🎯 Key Takeaway
Use a hub-spoke subscription model to isolate environments and enforce governance.

Resource Group Design Patterns

There are two common patterns: (1) Resource group per application component (e.g., web-rg, db-rg, cache-rg) and (2) Resource group per environment (e.g., prod-rg, staging-rg, dev-rg). The first pattern is better for microservices where each component has independent lifecycle. The second is simpler for monolithic apps. A hybrid approach is also common: use environment-level resource groups for shared infrastructure (networking, monitoring) and component-level groups for application services. Always use tags to add metadata like environment, owner, and cost center. This enables filtering and automation.

tag-resource-group.shBASH
1
az group update --name prod-web-rg --tags Environment=Prod Owner=team-web CostCenter=12345
Output
{
"id": "/subscriptions/.../resourceGroups/prod-web-rg",
"name": "prod-web-rg",
"tags": {
"Environment": "Prod",
"Owner": "team-web",
"CostCenter": "12345"
}
}
🔥Tag Inheritance
Tags on resource groups are not inherited by resources. You must apply tags to resources explicitly, or use Azure Policy to enforce tag inheritance.
📊 Production Insight
We used a single resource group for an entire microservices platform. When we needed to update the database, we had to redeploy the entire group, causing unnecessary downtime. Now we separate by component.
🎯 Key Takeaway
Choose a resource group design that matches your application lifecycle and team structure.

RBAC and Subscriptions/Resource Groups

Azure RBAC allows you to grant granular permissions at subscription or resource group scope. Common roles include Owner, Contributor, and Reader. For production, follow the principle of least privilege: assign Contributor at the resource group level, not subscription. Use custom roles for specific needs, like 'VM Operator' that can start/stop VMs but not delete them. Avoid assigning roles to individuals; use Azure AD groups instead. This simplifies management when team members change. Also, use Azure Privileged Identity Management (PIM) for just-in-time access to critical subscriptions.

assign-rbac.shBASH
1
2
3
az role assignment create --assignee 'team-web@contoso.com' \
  --role 'Contributor' \
  --scope /subscriptions/1234-5678-90ab-cdef/resourceGroups/prod-web-rg
Output
{
"id": "/subscriptions/.../providers/Microsoft.Authorization/roleAssignments/...",
"principalName": "team-web@contoso.com",
"roleDefinitionName": "Contributor",
"scope": "/subscriptions/.../resourceGroups/prod-web-rg"
}
⚠ Avoid Subscription-Level Owner
Granting Owner at subscription scope gives full control over all resources. Use management groups to delegate ownership of groups of subscriptions instead.
📊 Production Insight
A former employee had Owner access at the subscription level. After they left, we discovered they had created a backdoor VM. Now we use PIM and audit all role assignments monthly.
🎯 Key Takeaway
Assign RBAC at the resource group level and use Azure AD groups for team access.

Cost Management Across Subscriptions

Azure Cost Management provides tools to analyze and optimize spending across subscriptions. Use budgets and alerts to get notified when spending exceeds thresholds. Tag resources with cost center and environment to enable chargeback. For multi-subscription environments, use Azure Cost Management views that aggregate costs across subscriptions. Consider using Azure Reservations and Savings Plans for predictable workloads, but apply them at the management group scope to share benefits across subscriptions. Regularly review underutilized resources and use Azure Advisor recommendations to right-size VMs and databases.

create-budget.shBASH
1
2
3
4
5
6
az consumption budget create --budget-name 'prod-monthly' \
  --amount 10000 \
  --time-grain Monthly \
  --time-period start-date=2026-01-01 end-date=2026-12-31 \
  --scope /subscriptions/1234-5678-90ab-cdef \
  --notifications '{"thresholdType":"Actual","threshold":80,"enabled":true,"contactEmails":["finance@contoso.com"]}'
Output
{
"name": "prod-monthly",
"amount": 10000,
"timeGrain": "Monthly",
"currentSpend": {
"amount": 0,
"unit": "USD"
}
}
💡Use Budgets Proactively
Set budgets at 80% and 100% of your expected spend. This gives you time to react before overages occur.
📊 Production Insight
We once forgot to delete a test environment and it ran for three months, costing $50k. Now we use automated shutdown schedules and budget alerts to catch such waste early.
🎯 Key Takeaway
Use budgets, tags, and reservations to control and optimize costs across subscriptions.

Automating Subscription and Resource Group Creation

For large organizations, manual creation of subscriptions and resource groups is error-prone and slow. Use Azure Blueprints or Terraform to define a standard set of resources, policies, and RBAC. For example, a blueprint can create a resource group with required tags, assign a policy to enforce encryption, and grant Contributor access to a team. Use Azure CLI or PowerShell in CI/CD pipelines to create subscriptions programmatically (requires appropriate permissions). Always use infrastructure as code (IaC) to ensure consistency and auditability. Store IaC in a version-controlled repository.

main.tfHCL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
resource "azurerm_resource_group" "example" {
  name     = "prod-web-rg"
  location = "East US"
  tags = {
    Environment = "Production"
    CostCenter  = "12345"
  }
}

resource "azurerm_virtual_network" "example" {
  name                = "prod-web-vnet"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["10.0.0.0/16"]
}
Output
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
🔥Subscription Creation Permissions
Creating new subscriptions requires elevated permissions (e.g., Billing Administrator or Enterprise Agreement admin). Automate via Azure CLI or REST API with a service principal.
📊 Production Insight
We used to create subscriptions manually, leading to inconsistent naming and missing policies. Now we use Terraform modules that enforce our standards, and we catch issues in code review before deployment.
🎯 Key Takeaway
Automate subscription and resource group creation with IaC to ensure consistency and reduce manual errors.

Monitoring and Auditing Subscriptions and Resource Groups

Use Azure Monitor and Azure Activity Log to track changes to subscriptions and resource groups. Set up alerts for critical events like resource deletion, role assignment changes, or policy violations. Use Azure Policy's 'audit' effect to log non-compliant resources without blocking them. For security, enable Azure Defender for Cloud to get recommendations and threat detection across subscriptions. Regularly review the Activity Log for suspicious activities. Export logs to Log Analytics or a SIEM for long-term retention and analysis.

create-activity-log-alert.shBASH
1
2
3
4
az monitor activity-log alert create --name 'delete-resource-group' \
  --resource-group prod-monitoring-rg \
  --condition category=Administrative operationName=Microsoft.Resources/subscriptions/resourceGroups/delete \
  --action-groups /subscriptions/.../resourceGroups/prod-monitoring-rg/providers/microsoft.insights/actionGroups/ops-team
Output
{
"id": "/subscriptions/.../providers/Microsoft.Insights/activityLogAlerts/delete-resource-group",
"name": "delete-resource-group",
"type": "Microsoft.Insights/activityLogAlerts"
}
⚠ Activity Log Retention
Azure Activity Log retains data for 90 days. For longer retention, export to a Log Analytics workspace or storage account.
📊 Production Insight
We missed a critical alert because the Activity Log alert was configured on the wrong subscription. Now we centralize all alerts in a dedicated monitoring subscription and use cross-subscription queries.
🎯 Key Takeaway
Monitor subscription and resource group changes with Activity Log alerts and Azure Policy audit effects.

Disaster Recovery and Subscription Design

For disaster recovery, consider using paired regions (e.g., East US and West US). Design your subscription and resource group structure to support failover. For example, have a secondary subscription in the paired region with identical resource groups and resources. Use Azure Site Recovery to replicate VMs and databases. Test failover regularly. Also, consider using Azure Policy to enforce that critical resources have backups enabled. For multi-region deployments, use Azure Traffic Manager or Front Door to route traffic. Ensure that your subscription limits (e.g., vCPU quotas) are sufficient in the secondary region.

check-vm-quota.shBASH
1
az vm list-usage --location eastus --output table
Output
Name CurrentValue Limit
Total Regional vCPUs 120 250
Standard DSv3 Family vCPUs 50 100
🔥Quota Increases
Request quota increases for critical VM families in both primary and secondary regions well before a disaster. Increases can take days to process.
📊 Production Insight
During a regional outage, we failed over to our secondary region but hit vCPU quota limits, causing partial unavailability. Now we pre-allocate quotas in both regions and test failover quarterly.
🎯 Key Takeaway
Design subscriptions and resource groups to support disaster recovery with paired regions and sufficient quotas.

Common Pitfalls and How to Avoid Them

Common mistakes include: (1) Using a single subscription for everything, leading to hitting limits and security issues. (2) Not using resource groups, or putting all resources in one group, making management impossible. (3) Assigning Owner role at subscription scope to individuals. (4) Not tagging resources, making cost analysis difficult. (5) Ignoring policy enforcement until after deployment. To avoid these, start with a clear subscription and resource group design, enforce policies early, use IaC, and regularly audit your environment. Also, avoid moving resources between groups/subscriptions unless absolutely necessary.

audit-resource-groups.shBASH
1
az group list --query "[?tags.Environment==null].{Name:name, Location:location}" --output table
Output
Name Location
untagged-rg eastus
⚠ Resource Group Deletion
Deleting a resource group deletes all resources inside it. There is no recycle bin. Always use resource locks to prevent accidental deletion.
📊 Production Insight
We once deleted a resource group that contained a production database because the naming was ambiguous. Now we enforce a naming convention and use resource locks on all production resource groups.
🎯 Key Takeaway
Avoid common pitfalls by planning ahead, using IaC, and enforcing policies from day one.
Subscription vs Resource Group: Scope and Usage Key differences in hierarchy, RBAC, and cost management Subscription Resource Group Scope Billing boundary and policy assignment Logical container within a subscription RBAC Application Assign roles at subscription level Assign roles at resource group level Cost Management Aggregate costs across all resources Track costs for grouped resources Resource Limit Up to 10,000 resource groups per subscri No limit on resources per group Lifecycle Long-lived, rarely deleted Often created and deleted with projects THECODEFORGE.IO
thecodeforge.io
Azure Subscriptions Resource Groups

Next Steps: From Beginner to Production-Ready

Now that you understand subscriptions and resource groups, start by auditing your current Azure environment. Identify unused subscriptions and resource groups. Implement a naming convention and tagging strategy. Use Azure Policy to enforce compliance. Automate creation with Terraform or Bicep. Set up cost management and monitoring. Finally, document your subscription and resource group design in a runbook. This will save your team countless hours of troubleshooting and prevent costly mistakes. Remember, good architecture is proactive, not reactive.

export-resource-group-template.shBASH
1
az group export --name prod-web-rg --include-parameter-default-value > rg-template.json
Output
Template exported to rg-template.json
💡Start Small
Don't try to redesign everything at once. Start with one subscription and one resource group, apply best practices, and expand gradually.
📊 Production Insight
The best investment we made was creating a 'Azure Foundations' runbook that documents our subscription hierarchy, naming conventions, and policies. New team members can get up to speed in hours instead of weeks.
🎯 Key Takeaway
Audit, automate, and document your subscription and resource group design to achieve production readiness.
⚙ Quick Reference
12 commands from this guide
FileCommand / CodePurpose
list-subscriptions.shaz account list --output tableWhy Azure Subscriptions Matter
create-resource-group.shaz group create --name prod-web-rg --location eastusResource Groups
move-resource.shaz resource move --destination-group prod-db-rg \Subscription vs Resource Group
assign-policy.shaz policy assignment create --name 'require-costcenter-tag' \Organizing Subscriptions for Production
tag-resource-group.shaz group update --name prod-web-rg --tags Environment=Prod Owner=team-web CostCe...Resource Group Design Patterns
assign-rbac.shaz role assignment create --assignee 'team-web@contoso.com' \RBAC and Subscriptions/Resource Groups
create-budget.shaz consumption budget create --budget-name 'prod-monthly' \Cost Management Across Subscriptions
main.tfresource "azurerm_resource_group" "example" {Automating Subscription and Resource Group Creation
create-activity-log-alert.shaz monitor activity-log alert create --name 'delete-resource-group' \Monitoring and Auditing Subscriptions and Resource Groups
check-vm-quota.shaz vm list-usage --location eastus --output tableDisaster Recovery and Subscription Design
audit-resource-groups.shaz group list --query "[?tags.Environment==null].{Name:name, Location:location}"...Common Pitfalls and How to Avoid Them
export-resource-group-template.shaz group export --name prod-web-rg --include-parameter-default-value > rg-templa...Next Steps

Key takeaways

1
Subscriptions are billing and isolation boundaries
Use multiple subscriptions for different environments and cost centers to avoid hitting limits and to isolate blast radius.
2
Resource groups are lifecycle containers
Group resources that are deployed, managed, and retired together. Use consistent naming and tagging for clarity.
3
RBAC and policies should be applied at the resource group scope
Follow least privilege and use Azure AD groups to simplify access management.
4
Automate everything with IaC
Use Terraform, Bicep, or Azure Blueprints to create subscriptions and resource groups consistently, and enforce policies from the start.

Common mistakes to avoid

3 patterns
×

Not planning subscriptions resource groups properly before deployment

Fix
Design your architecture with redundancy, scaling, and security in mind from the start.
×

Ignoring Azure best practices for subscriptions resource groups

Fix
Follow Microsoft's Well-Architected Framework and review Azure Advisor recommendations regularly.
×

Overlooking cost implications of subscriptions resource groups

Fix
Set budgets and alerts, right-size resources, and use Azure pricing calculator before deploying.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
Explain Subscriptions & Resource Groups and its use cases.
Q02JUNIOR
How does Subscriptions & Resource Groups handle high availability?
Q03JUNIOR
What are the security best practices for subscriptions resource groups?
Q04JUNIOR
How do you optimize costs for subscriptions resource groups?
Q05JUNIOR
Compare Azure subscriptions resource groups with self-hosted alternative...
Q01 of 05JUNIOR

Explain Subscriptions & Resource Groups and its use cases.

ANSWER
Microsoft Azure — Subscriptions & Resource Groups is an Azure service for managing subscriptions resource groups in the cloud. Use it when you need reliable, scalable subscriptions resource groups without managing underlying infrastructure.
FAQ · 6 QUESTIONS

Frequently Asked Questions

01
What is the difference between a subscription and a resource group?
02
Can I move a resource group to a different subscription?
03
How many resource groups can I have in a subscription?
04
What is the best practice for organizing subscriptions in a large enterprise?
05
How do I prevent accidental deletion of a resource group?
06
Can I apply Azure Policy at the resource group level?
N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Everything here is grounded in real deployments.

Follow
Verified
production tested
July 12, 2026
last updated
436
articles · all by Naren
🔥

That's Azure. Mark it forged?

4 min read · try the examples if you haven't

Previous
Microsoft Azure — Getting Started with Azure
3 / 55 · Azure
Next
Microsoft Azure — Azure Resource Manager (ARM)