An Azure resource group collects related cloud resources so they are easier to organize and manage. Create or select one when provisioning a private container registry or a managed Kubernetes cluster. A resource group for an application can also be the first piece of infrastructure created with Terraform, before the other Azure resources it will contain. section 3.9.1 section 6.9 section 7.8
Choose how to create it:
- In the Azure portal, select an existing resource group or click Create New, enter a meaningful name, and click OK. The name need not match the container registry’s name or be globally unique. section 3.9.1
- With Terraform, declare an `azurerm_resource_group` resource in `resource-group.tf`, setting its `name` and `location`. The resource type is supplied by the Azure provider. section 7.8 section 7.8.2
Listing 7.1 Creating an Azure resource group
resource "azurerm_resource_group" "flixtube" { #1
name = "flixtube" #2
location = "eastus" #3
}
This minimal Terraform declaration creates a resource group named `flixtube` in `eastus`. section 7.8.2
Run `terraform apply`, inspect the proposed changes, and enter `yes` to approve them. On the first run, Terraform reports one resource added. To check the result directly, open Resource Groups in the Azure portal and find the new group. Terraform can subsequently destroy and recreate the infrastructure with `terraform destroy` and `terraform apply`. section 7.8.6 section 7.8.9



