az group create: Resource Groups & CI Errors
Create the resource group that holds your Azure resources.
az group create makes an Azure resource group - the container almost every other Azure resource lives in. CI scripts usually create it idempotently before deploying into it.
What it does
az group create --name <rg> --location <region> creates a resource group in the given Azure region. Resource groups are logical containers for billing, access control, and lifecycle. Re-running create with the same name and location is a no-op (it returns the existing group), so it is safely idempotent.
Common usage
# Create a resource group
az group create --name my-rg --location eastus
# Idempotent guard in CI
az group exists --name my-rg \
|| az group create --name my-rg --location eastus
# Tag at creation
az group create --name my-rg --location eastus --tags env=prod team=ciCommon error in CI: invalid location / authorization failed
Creation fails with "The provided location \"east-us\" is not available" when the region name is malformed (use az account list-locations -o table for valid names like eastus, westeurope), or "AuthorizationFailed ... does not have authorization to perform action Microsoft.Resources/subscriptions/resourceGroups/write" when the principal lacks rights. Fix: pass a valid region short name, confirm the active subscription (az account show), and grant the service principal at least Contributor scoped to the subscription or a parent management group.
Key options
| Option | Purpose |
|---|---|
| --name / -n | Resource group name |
| --location / -l | Azure region (e.g. eastus) |
| --tags | Key=value tags |
| az group exists -n NAME | Idempotency check |