Ansible in a Minute · Certified Collections ·
Create an Azure resource group
Short answer
Use azure.azcollection to create an Azure resource group in a chosen region.
Subscribe for updates
Get an email whenever we publish new guides and blog posts. Unsubscribe anytime.
By subscribing you agree we may email you about Ansible in a Minute and related Level Up Labs updates. We store your address in the same lead sheet as our contact form.
Request
create azure resource group rg-app-prod in eastus
Example
A quick heads-up: Every environment is different. Review and test this example before you run it on systems you care about.
---
- name: Create an Azure resource group
hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Ensure resource group exists
azure.azcollection.azure_rm_resourcegroup:
name: rg-app-prod
location: eastus
state: presentHow it works
azure_rm_resourcegroup creates or updates a resource group. Provide Azure credentials through the usual Azure Ansible authentication methods before you run the playbook.
When to use it
- Creating a landing resource group for a new application
- Keeping resource group names and regions in source control
Requirements
- Collection: azure.azcollection
- Technology: Microsoft Azure
- azure.azcollection collection installed
- Azure credentials available to Ansible
Validation
- Syntax validated
- Not execution-tested
- Last verified 2026-09-09
Notes
Choose the region your organization standardizes on. Confirm naming conventions before you create shared subscription resources.
Built for every Ansible use case in every organization
BacklogZero can generate this kind of automation in your environment, just like it did here.