How to create a Resource Group in Azure

This Azure article will discuss the quick steps to create a Resource Group in Azure.

How to create Resource Group in Azure

Follow the below steps to create Azure 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 azure resource group

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
create azure resource group

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 must install Azure PowerShell (Microsoft Azure PowerShell) on your machine. 

If you have the Microsoft Azure PowerShell module installed on your computer, follow the steps below.

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 its version and consider installing the latest version. Use the PowerShell cmdlet below 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 log in 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 the resource group’s name, and the location parameter sets its location.

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

How to create Resource Group in Azure CLI

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 Azure Resource Group – Video Tutorial

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

You may also like following the articles below

Conclusion

This Azure article discussed how to create a Resource Group in Azure. Thanks for reading this article !!!