Understand Management Groups in Azure
Azure Management Groups allow you to organize your resources and apply governance at different levels. By default, all subscriptions are part of a single root management group. One reason to create a management group is to bundle subscriptions together. Only management groups and subscriptions can become children of another management group. A subscription that moves to a management group inherits all user access and policies from the parent management group.
You can move subscriptions between management groups. A subscription can have only one parent management group.
Important facts about management groups
Each management group and subscription can support only one parent.
Each management group can have many children.
https://learn.microsoft.com/en-us/azure/governance/management-groups/overview
In Azure, a subscription can only belong to one management group at a time. Since you have only one subscription, it cannot be assigned to multiple management groups for Dev, Test, and Prod environments.
Given this limitation, to effectively manage and segregate your Dev, Test, and Prod environments within a single subscription, you can use Resource Groups, Management Tags, and Azure Policies. Here's an updated step-by-step guide to help you achieve your goal.
-
- Step 1: Understand Organizational Options within a Subscription
- Resource Groups: Logical containers that hold related resources for an Azure solution, which can be used to separate environments.
- Tags: Key-value pairs that allow you to categorize resources and resource groups.
- Azure Policies: Used to enforce organizational standards and to assess compliance at-scale.
- Sign in to the Azure Portal.
- Navigate to Resource Groups.
- Click on + Create.
- For each environment, create a new resource group:
- Resource Group Name: e.g.,
rg-dev
,rg-test
,rg-prod
. - Region: Select the appropriate region for your resources.
- Resource Group Name: e.g.,
- Click Review + Create and then Create.
- Deploy resources (VMs, databases, storage accounts, etc.) into the corresponding resource groups based on their environment.
- This separation ensures that resources for Dev, Test, and Prod are logically grouped.
- For each resource group or individual resource, navigate to the Tags section.
- Add tags to represent business units and other relevant metadata:
- Key:
BusinessUnit
- Value: e.g.,
Sales
,Marketing
,Finance
- Key:
- Apply multiple tags if necessary to capture additional information.
- Navigate to Azure Policy in the Azure Portal.
- Click on Assignments and then + Assign Policy.
- Scope the policy to your subscription or specific resource groups.
- Select built-in policies or create custom policies to enforce rules such as:
- Allowed resource types.
- Enforcing tagging standards.
- Restricting deployment locations.
- Review and Create the policy assignment.
- Navigate to the Resource Group you want to assign roles to.
- Click on Access Control (IAM).
- Click on + Add and select Add role assignment.
- Choose the appropriate role (e.g., Contributor, Reader) for users or groups.
- Assign users or teams to resource groups based on their environment (Dev, Test, Prod) and business unit.
- Go to Cost Management + Billing in the Azure Portal.
- Under Cost Management, select Budgets.
- Click on + Add to create a new budget for each environment:
- Filters: Select the resourcegroupname(
rg-dev
,rg-test
,rg-prod
). - Budget Amount: Set the budget limit and provide Budget details as per ur requirements
- Filters: Select the resourcegroupname(
- Review and Create the budget.
- In Cost Management + Billing, navigate to Cost Analysis.
- Use Filters to view costs by:
- Resource Group: See costs per environment.
- Tags: Analyze costs per business unit.
- Generate reports and export data as needed.