Let’s Azure : Manage Azure Resource Group

TechFarm by Shahjahan
Let’s Azure
Published in
5 min readSep 21, 2021

Before we move toward the core of this story, let’s understand in brief the importance of resource groups.

Resource groups are essentially a solution for organizing and grouping our azure services and resources. Think of it as a container where one or more resources resides. While Azure allows us to put all our resources into a single resource groups, it also allows to create individual resource groups for each of the services or resources. However the best practice is to create multiple but not too many resource groups in such manner that groups similar resources into one resource group. The groups can be categorized based on types of resources, functionality, life cycle, criticality, data store, location etc. depending on the nature of business.

When we start building an Azure Infra, the first tasks should be to come up with the categorization criteria based on which the resources will be grouped. Then come up with a naming guidelines for resource groups and create these resource groups following the naming guidelines.

Using default resource group — Every time we create a resource, it provides functionality to use a default resource group or add a new one just for that resource. We shouldn’t use both these options. The best practice here is to create resource groups for services, technologies or features and group the resources accordingly.

Here is an example of how the resource grouping can be designed

Creating a resource group

Creating a new resource group involve few simple steps only.

Login to the Azure portal with you subscription login. Ensure that you have the owner or contributor privilege. On the landing page, click on either create-a-resource link. You can also click on resource-group link and click on create. This with take you to the create-a-resource-group page.

On the basic tab there’s only three simple but important configurations to be filled.

If you have multiple active subscriptions, select the subscription in which you want the resource group to be created.

Next give your resource group a name. A name that is meaningful, a name that meets your organizational needs and a name that follows your naming convention. A part of this we have discussed in the section above.

Next select the geographical region. Not always the nearest region will be correct choice here. This will driven by your data residency and compliance requirement. So the advisory here would be to talk to your compliance and security team before you decide on the regions.

Click on “Next” and this will take you to “Tags” tab. Add the tags for this resource group. Tags are optional but they are very important. If tags sounds complex or confusing, refer to our story on the topic — Let’s Tag — detailing the tags and tagging best practices.

Click on “Next” and this will take you to “Review” tab displaying all the settings of the to-be-created resource group. The best practice here is not-to-hurry and review it all line by line.

Once reviewed, click on “create” and then wait for the system to deploy the resource group. When you see a blue button titled “go-to-resource”, click on the button for the yahoo moment.

Deleting a resource group

To delete a resource group go to the resource group list page. Click on the desired resource group to be deleted, which open up the overview page of the resource group. the click on the Delete resource group button and confirm. You cannot delete a resource group if the resource group is locked or you don't have appropriate permission.

Deleting any resource group deletes all its child resources as well as other resources managed by these child resources.

To delete a particular resource (or multiple resources) from a resource group, on the listing page of resource group select all the resources you want to delete and then click on Delete button. Note that this Delete button is different from Delete resource group button and it gets enabled only when we select at least one resource.

Locking a resource group

When a resource group is locked it cannot be edited or deleted. Applying lock at resource group level gets inherited into resources in the scope including the resources added prior to the lock as well as ones added later. If there are multiple locks applied to a resource group or child resource, the most restrictive lock takes precedence.

Adding or deploying resources to a resource group

There are essentially two ways to deploy a resource into a resource group

Moving resources between resource groups

We can move a resource from one resource group to another in the same subscription or to a different subscription. We can move a resource from one region to another region, when needed. For moving one or multiple resources, go to the listing page of resource group, select the resources to be moved and then click on move button.

Move button give 3 options to choose from.

If we choose to move to another subscription option. This will take you a wizard.

Choose the target Subscription and target Resource Group. If resource group doesn’t exist, can create a new one from the same wizard using create new link. Click on next and this will take you through a verification process.

Wait till the status shows Validation Success. Click on next to review and then move. Verify in the target resource group if the resource is moved.

Isn’t it interesting. If you like this and wanna read more on Azure, follow Let’s Azure and also click here to Follow this author.

If this story is helpful for you forward to your friends and if you have suggestions, do let us know your thoughts in comments.

Happy Azuring and Happy Coding !!!!

--

--

TechFarm by Shahjahan
Let’s Azure

Passionate Enterprise Architect | GenAI Expert | Cloud Architect | Digital Transformation Strategist | Blockchain Enthusiast | Learning Leader