A minimal Pulumi template for provisioning an Azure Resource Group and a Storage Account using the Azure Native provider with Python.
This template demonstrates:
- Provider:
pulumi-azure-native - Resources:
azure-native:resources:ResourceGroup— a new resource groupazure-native:storage:StorageAccount— a storage account in the resource group
- Output:
primary_storage_key— the primary key of the storage account
Use this template as a starting point to learn Pulumi, author infrastructure-as-code in Python, and build on top of basic Azure resources.
- An Azure subscription with sufficient permissions
- Azure CLI installed and authenticated (
az login) - Python 3.7 or later
-
Create a new project from this template:
pulumi new azure-python
-
When prompted, enter your project name, description, and Azure location. The default
azure-native:locationisWestUS2. -
Deploy the stack:
pulumi up
.
├── __main__.py # Pulumi program defining your infrastructure
├── Pulumi.yaml # Project settings and template metadata
└── requirements.txt # Python dependencies (Pulumi SDK and provider)
This template exposes the following configuration variable:
azure-native:location— Azure region to deploy resources. Defaults toWestUS2.
Set or override it with:
pulumi config set azure-native:location eastusAfter deployment, the following output is available:
primary_storage_key— the primary access key for the storage account
Retrieve it with:
pulumi stack output primary_storage_key- You want a quick Azure infrastructure starter with Pulumi and Python
- You're learning infrastructure-as-code patterns on Azure
- You need a simple storage account setup to build applications
- Customize resource names and add more Azure services (e.g., Virtual Networks, Key Vault)
- Explore the
pulumi-azure-nativedocumentation for available services - Migrate this template into a larger multi-stack setup
- Pulumi Documentation: https://www.pulumi.com/docs/
- Azure Native Provider Reference: https://www.pulumi.com/registry/packages/azure-native/
- Community Support: https://pulumi.com/community/