Learn Azure Administration
上QQ阅读APP看书,第一时间看更新

Managing resource groups

A resource group is the main logical component when it comes to governing resources provisioned in Azure. You cannot create a service without selecting one – this is why learning the basic principles of managing resource groups is crucial for becoming a better Azure administrator. We will focus on things such as performing basic actions on resource groups, moving resources, and managing them so that you can learn all the necessary operations required on a daily basis.

To get started, you'll need a resource group. Creating one is one of the easiest operations in Azure – you can use the Azure portal, PowerShell cmdlet, or Azure CLI for this. If you prefer using the graphics interface, search for the Resource group term in the marketplace and click on the Create button. You will see a really simple form where you only need to provide two things:

  • Resource group name
  • Resource group location

The following is an example configuration for my resource group:

Figure 2.5: Creating a resource group
If you have more than a single subscription available, you will have to provide that value as well.

When everything is ready, you can just click the Review + Create button to start the process of creating an RG. Using Azure CLI or PowerShell is also just as easy. Here, you can find a command and a result when using the CLI. We will provide additional details such as its location and subscription to avoid mistakes:

$ az group create --name "azurecli-euw-rg" --location "West Europe" --subscription "Pay-As-You-Go"

The result of creating a resource group looks like this:

{
"id": "/subscriptions/.../resourceGroups/azurecli-euw-rg",
"location": "westeurope",
"managedBy": null,
"name": "azurecli-euw-rg",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null
}

As an alternative, you can use Azure PowerShell, as shown here:

PS C:\Users\kamz> New-AzResourceGroup -Location "West Europe" -Name azurepowershell-euw-rg

PowerShell's output is quite different in terms of its structure but provides similar information to the Azure CLI:

ResourceGroupName : azurepowershell-euw-rg
Location : westeurope
ProvisioningState : Succeeded
Tags :
ResourceId : /subscriptions/.../resourceGroups/azurepowershell-euw-rg

Now, we are ready to learn about some additional management activities.