az group create: Provision Resource Groups in CI
Create an Azure resource group in a given region.
az group create provisions a resource group, the container for all other Azure resources. In CI it is often the first infra step or a guard before deploying. The command is idempotent in practice: re-running with the same name and location succeeds.
Common flags
-n NAME- the resource group name-l LOCATION- region, e.g. eastus--tags KEY=VALUE- apply tags at creation
Example in CI
Create or confirm a resource group with tags.
shell
az group create \
-n my-rg -l eastus \
--tags env=ci sha=${GITHUB_SHA::7}Common errors in CI
- LocationNotAvailableForResourceGroup - invalid or misspelled region
- AuthorizationFailed: ... does not have authorization ... write - SP lacks Contributor on the subscription
- MissingSubscription - no active subscription selected after login
Key takeaways
- Creates the resource group that holds all other Azure resources.
- Re-running with the same name and location is effectively idempotent.
- Requires Contributor on the subscription and a valid region string.
Related guides
az login: Authenticate Azure CLI in CIAuthenticate the Azure CLI in CI with a service principal or federated token: flags, an example, and the auth…
az storage blob upload: Upload to Blob in CIUpload a file to Azure Blob Storage from CI: container and auth flags, an example, and the storage errors you…
az keyvault secret show: Read Key Vault in CIRead a secret from Azure Key Vault in CI: flags to extract the value, an example, and the access policy error…