What is Resource Group in Azure

What is Resource Group in Azure

In this Azure tutorial, we will discuss What is Resource Group in Azure. Along with this, we will also discuss a few other related topics.

What is resource group in Azure

Well, let’s discuss here What a resource group is in Azure.

Resource Group in Azure is nothing but a logical container where you are creating your Azure resources. That holds all your Azure Resources. A resource group created in a specific region can contain the resources created in the other regions. There is no restriction on that.

What is resource group in Azure
Azure resource group

Resource groups are also called the central unit that acts like a logical container that holds all the Azure resources.

You need a Resource Group to be created while creating any resources in Azure Portal. These are a few of my understanding of What is Resource Group in Azure

A resource is the instances of service that you create or an asset like Azure Virtual Machines, Azure storage, etc, that are created in Azure for multiple purposes.

What is the purpose of a resource group?

Resource Groups in Azure is the approach to group the collection of resources that helps for easy maintenance of the Resources, for example, easy monitoring, automatic provisioning, etc. This is the primary Purpose of the ResourceGroups.

Behind the scenes, Azure Resource Manager (ARM) is a technology that helps Azure with its activities.

Why do we need a resource group in Azure?

A Resource Group is a logical container that stores the metadata of the resources that helps with the administration activities and the cost management of the group of resources and also helps with the easy control of the role-based access.

How do I organize my Azure Resource Group?

There are 4 levels of management scope that Azure provides to manage the Azure Resources

  • Management Groups
  • Subscriptions
  • Resource Groups
  • Resources
How do I organize my Azure Resource Group

Management Groups

Management Groups are containers for multiple subscriptions that help to manage access and compliance. All subscriptions under the management groups inherit all the properties from the Management Groups.

Subscriptions

A Subscription is used to manage the costs and the number of resources created based on the plan for a user account or for an Organisation. Each subscription has limits on the number of resources you can create and use based on the plan. 

Resource Groups

Resource Group is a logical container for creating your Azure resources. That holds all your Azure Resources.

Resources

A resource is the instances of service that you create, like Azure Virtual Machines, Azure Storage, Azure SQL, etc, that are made in Azure for multiple purposes.

Create a Resource Group in Azure

Let’s discuss here how to create a resource group in Azure Portal. Follow the below steps to create a resource group in Azure Portal.

1. Log in to Azure Portal (https://portal.azure.com/)

2. Now, After logging in to the Azure Portal, search for the “Resource Groups” and click on the search result.

Create Resource Group azure

3. Then, on the Resource groups page, click on the +Add button

How to create Resource Group azure

4. On the Create a Resource group page, provide the below details

  • Subscription: Choose your subscription
  • Resource group: Enter a valid name for the Resource group
  • Region: Choose a region for the Resource group
How to create a Resource Group azure

Click on the Review + Create button.

5. It will show that Validation passed. Then click on the Create button on the Create a resource group page.

How to create a Resource Group in azure

Now you can see the Resource group was created successfully.

what is Azure resource group

This is how we can create a resource group using the Azure Portal.

Creating a Resource Group in Azure using PowerShell

We saw above how to create a resource group using the Azure Portal. Now we will discuss here: How do I create a resource group in Powershell?, Follow the below steps to create a resource group using PowerShell.

Before creating the resource group in PowerShell, you need to make sure that you need to install Azure PowerShell (Microsoft Azure PowerShell) on your machine. 

Assuming that you have the Microsoft Azure PowerShell module installed on your computer, next is to follow the below steps.

Open the PowerShell ISE or Windows PowerShell module as Run as Administrator mode

how to create resource group in azure powershell

If you have installed the Azure PowerShell module. Check the version of the module and consider installing the latest version. Use the below PowerShell cmdlet to check the version.

PS C:\WINDOWS\system32> Get-Module -ListAvailable -Name AzureRm.Resources | Select Version
create a resource group in Powershell

Login to Azure account

Before working with the Azure resource group, use the Login-AzureRmAccount cmdlet to login to your Azure Account.

PS C:\WINDOWS\system32> Login-AzureRmAccount
Create a resource group using Powershell

Provide your Azure credentials to log in and move to the next step.

Get subscription details

You can check the Subscription details using the below PowerShell cmdlet in case you have multiple subscriptions.

PS C:\WINDOWS\system32> Get-AzureRmSubscription
what are azure resource groups

In case of multiple Subscription, use the below cmdlet to switch for a particular Subscription

PS C:\WINDOWS\system32> Set-AzureRmContext –SubscriptionId {SubscriptionId}

You can also use the below PowerShell cmdlet

PS C:\WINDOWS\system32> Set-AzureRmContext -SubscriptionName "{SubscriptionName}"

Create a Resource Group

Finally, use the New-AzureRmResourceGroup cmdlet to create a resource group

PS C:\WINDOWS\system32> New-AzureRmResourceGroup -Name mynewresgrp -Location "Central US"

The name parameter specifies a name for the resource group, and the location parameter sets the location of the resource group.

This is how you can create a resource group using PowerShell.

How do I create a resource group in Azure CLI?

Well, let’s see how to create a resource group in Azure using Azure CLI. You can use the below Azure CLI scripts to create a resource group

$resourceGroupName = "MyNewresgroup"
$location = "East US"

az group create --name $resourceGroupName --location $location

Once it is created, you can use the below command to list all the resource groups

az group list

How to create a Resource Group in Azure – Video Tutorial

This video tutorial will help you know the initial steps to create a Resource Group in Azure.

How do I find a Resource Group in Azure?

There are multiple ways to find all the Resource Groups in Azure Portal

Once you log in to the Azure Portal, You can click on the Resource Groups link from the left navigation. It will show you the list of Resource groups present.

How do I find a Resource Group in Azure

Or, you can search for the Resource groups and click on the search result link to get the list of Azure resource groups

How to find the Resource Group in Azure

Azure Resource Groups best practices

Below are a few best practices for the Azure Resource Groups

  • It is recommended to create an Azure resource group per region where the resources will be located.
  • There is a built-in policy that will report when the resource location doesn’t match the resource group location. Per the policy, the resource location and the resource group location should be the same.

You can check out How to delete Resource Group in Azure

FAQs

Do Azure resource groups cost money?

The answer to this question is absolute No. There is no price for the Resource Group. You need to pay for the resources as per the pricing model. So you need to pay for the resources, not the Resource Groups.

What is a resource in Azure

  • A resource is an item that is manageable and available via Azure.
  • You can also call the resource the key component of Azure.

How many Resource Groups can a resource be added?

Each resource can only exist in one resource group. If one resource needs to exist on a different deployment cycle, it should be in another resource group.

How do I change Azure Resource Group?

Follow the below steps to change the Azure Resource Group.

Login to Azure Portal (https://portal.azure.com/)

Search for the resource that needs to be migrated to the different resource group.

How do I change Azure Resource Group

Click on the Move button and then select the Move to another resource group option on the Resource Page.

How can I change Azure Resource Group

Select the new Resource group where the resource needs to be moved and check that I understand that tools and scripts associated with moving resources will not work until I update them to use new resource IDs option.

Then click on the Ok button to move the resource to the new Azure Resource Group.

How to change Azure Resource Group

What is Azure resource manager?

Azure Resource Manager is the service that works behind the scenes with Azure Resource Groups. This provides a management layer that helps to create, update, delete, or manage the resources in your Azure account.

The benefits of using Resource Manager

There are many benefits to Azure Resource Manager

  • You can manage and monitor all the resources as a group easily with the help of Azure Resource Manager.
  • It helps you provide many templates that help you to manage your infrastructure.
  • Another important thing is it helps you to apply the tags to all resources, which helps to organize all your resources logically.
  • It helps to define the dependencies between all the Azure resources

You may also like going through the tutorials below

Conclusion

Well, in this article, We learned What is resource group in Azure. What is the purpose of a resource group?. Hope you will enjoy this Azure tutorial !!!.