In Azure, Resource Groups are a key concept for managing resources. They provide a logical way to group related resources, making it easier to manage and control access. However, as your cloud environment git bigger, organizing Resource Groups becomes more difficult.
This blog post explains common practices for using Azure Resource Groups. These tips will help you manage and organize your resources more effectively!
Azure Resource Group
Azure Resource Groups are logical containers that hold related resources, such as virtual machines, storage accounts, and networks. Every resource in Azure must belong to a Resource Group. A resource group can contain multiple Azure resources, but one Azure resource can only be contained in one resource group at a time. (1-n relation)
Key features of Resource Group are:
- Group related resources together for easier management.
- Deleting a resource group also deletes all resources inside it.
- Assign roles and permissions at the resource group level (IAM).
Resource Grouping Practices
Group Resources by Lifecycle
Put resources with the same lifecycle in the same resource group. This method is especially useful for marketing campaigns that only last for a period of time. Because deleting a resource group removes all related resources, avoiding unused resources, ensure you can have a one-click clean up of all the resources that will no longer be used.
For example, I have an Application that will only be used during the "double eleven" in China. This application may include virtual machines, storage accounts, databases, and networks. These can all go into one resource group, e.g. super-sales-d11-2025-group
, while long-term resources, like shared databases, can be placed in separate resource groups.
I have used this practice for systems that are only used one time on the annual party event in my organization.
Group Resources by Environment
Create separate resource groups for different environments, such as development, testing, and production. Use clear separation of environments to avoid interference between them. In this way, admins can also easily assign different permissions and monitor costs for each environment.
Example:
Moonglade-Dev
Moonglade-Test
Moonglade-Prod
This is the practice currently being used in my organization for our business apps.
Group Resources by Project or Department
You can also create resource groups for each projects or departments in your organization. This simplifies resource management across teams or departments, as well as makes it easier to track costs by project or department. It also allows assigning permissions specific to each team.
Example:
Finance-App
HR-System
Marketing-Campaign
You may also combine this practice with the environment practice above, like:
Finance-App-Dev
Finance-App-Prod
HR-System-Dev
HR-System-Prod
I found it useful for small and medium businesses.
Group Resources by Location
When your system is geographically distributed, you may group them to different resource groups in each location, using a consistent naming convention to make them easy to identify (like using a filter).
Example:
moonglade-prod-eastus
moonglade-prod-westus
moonglade-dev-eastasia
This blog you are reading right now is using this practice.
Naming Conventions
While grouping resources wisely is important, naming conventions also is essential for better organization, easier management, and improved clarity. A good naming convention typically includes key pieces of information about the resource group. A common format is:
[BusinessUnit]-[Project/Service]-[Environment]-[Region]
For example, I want to run my blog system for developers in my organization:
rnd-web-moonglade-prod-westus
rnd
means Retail and Direct, it's the name of my department.web
is the name of my team.moonglade
is the project name of this blog system.
Use Standard Abbreviations
To keep names short, use standard abbreviations. For example:
Dev
for DevelopmentProd
for ProductionTest
for TestingEU
for EuropeUS
for United States
Separate Words with Hyphens
Hyphens (-
) improve readability and are widely accepted in naming conventions.
Use Unified Casing
I personally prefer using all lowercase letters to name Azure resource groups (e.g. ediwang-app-rsg-us
), so I don’t have to constantly switch between uppercase and lowercase in case-sensitive systems. However, I found most people prefer using Pascal Case (e.g. My-Blog-WestUS
). It ultimately depends on personal preference, but it’s recommended to stay consistent.
Sadly, Azure itself is not using a consistent naming convention for resources that created automatically with default settings. Some times it is: cloud-shell-storage-southeastasia
, some times it will be NetworkWatcherRG
.
Tags (Optional)
Azure allows you to add Tags to resource groups. Tags are key-value pairs that help you identify ownership and purpose. For example:
Environment: Production
Project: Walmart
LOB: RnD
For resources that are not very easy to be grouped by just resource groups. Adding tags will give you another way to improve visibility and organization.
Conclusion
Azure Resource Groups are essential for managing Azure resources, but proper organization is key to efficient operations. By grouping resources by lifecycle, environment, or project, using naming conventions and tags, and following access control best practices, you can improve resource management and reduce complexity.
Comments