Microsoft Azure Administrator:Exam Guide AZ-103
上QQ阅读APP看书,第一时间看更新

Implementing and setting tagging on resource groups

You can apply tags to all of your Azure resources. This way, you add extra metadata to the resource group, which can be used to logically organize them into a taxonomy. Each tag consists of a name and a value pair. For instance, you can set the name to Environment and the value to Demo, or you can set the name to Maintenance Window and the value to Saturday 9 AM. After applying these tags, you can easily retrieve all the resources with the same tag name and value. This can be a useful feature for billing or management purposes.

For billing based on your tags, you can use the assigned tags to group the billing for certain resources; for example, if you run VMs and databases for different environments (test, pre-production, and production), you can use tags to categorize the costs. These tags will then show up in the different cost reporting views. For instance, they are visible in the cost analysis view immediately after they are created, and in the detail usage .csv after the first billing period.

You can create resource groups in Azure using the Azure portal, PowerShell, and the CLI. In this demonstration, we are going to create an Azure resource group in our subscription from the Azure portal. You can also set tagging on the resource group level, so we are going to do that, as well. Therefore, perform the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com.
  2. In the left-hand menu, select Resource groups:
Azure portal overview page
  1. In the Resource groups blade, click on the Add button in the top menu:
Creating a new resource group
  1. Fill in the following values:
    • Subscription: Select the subscription to which you want to add the resource group.
    • Name: PacktResourcegroup.
    • Region: Keep the default (Central US, in my case). You can also select another region, if you prefer.
  1. Next, select Tags in the top menu:
Adding tags to the resource group
  1. Add the following values to create a tag for this resource group:
    • NameEnvironment
    • Value: Demo
  2. Click on Review + Create, and then Create.
  3. Repeat these steps for some of the resources inside the subscription. In my case, I've added the same tag to the VM.

We have now created a new resource group and applied a tag to it. You can also manage your tags from the Tags blade of the resource group. In the next section, we're going to look at how to configure cost center quotas.