How to create a Resource Group in Microsoft Azure

This post is the first in a series in which I will show how to create different resources in Microsoft Azure. Today I will show you how to create an essential component: a Resource Group.

An Azure resource group is a collection of Azure resources that are implemented as a unit and contains Azure resources such as a storage account, virtual networks, Virtual Machines, or a website.

This tutorial assumes that you already have a Microsoft Azure account set up.

Azure PowerShell Workaround

If you want to know how to install the PowerShell Azure module on your machine, check out this link.

The simplest way to get started is to sign in interactively at the command line.

This cmdlet will bring up a dialog box prompting you for your email address and password associated with your Azure account.

If you have more than one subscription associated with your mail account, you can choose the default subscription. To perform this task we will use the following commands:

Once you set your default subscription, you are ready to create the resource group with New-AzureRmResourceGroup cmdlet.

Resource Group

To create a Resource Group with PowerShell, use the New-AzureRmResourceGroup cmdlet with the following syntax:

New-AzureRmResourceGroup

-Location Parameter

With the following cmdlet in PowerShell, we obtain the list of existing locations in Azure.

You can verify the task by running the Get-AzureRmResourceGroup cmdlet.

Azure CLI Workaround

You can use it in your browser with Azure Cloud Shell, or install it on your machine. If you want to know how to install the Azure CLI, check out this link.

The way to get started is to sign in interactively at the command line.

This command will bring up a dialog box prompting you for your email address and password associated with your Azure account.

If you have more than one subscription associated with your mail account, you can choose the default subscription. to perform this task we will use the following commands:

To create a Resource Group with Azure CLI, use the following syntax:

az group create

–location Parameter

With the following command, we obtain the list of existing locations in Azure.

As you can see in the screenshot, you can use the online command help with the –help or -h parameter.

az group create

You can check the task by running the following command:

If you want to know more about Azure Resource Groups, check out this link: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview