This example deploys a resource group, and a storage account, and has a workaround for the following issue storage account NetworkRuleSetResponseArgs has no attribute.
-
Initialize a new stack called
dev
via pulumi stack init.pulumi stack init dev
-
Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
az login
-
Create a Python virtualenv, activate it, and install dependencies:
This installs the dependent packages for our Pulumi program.
python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt
-
Set the config values via pulumi config set.
Here are Azure regions see this infographic for a list of available regions)
pulumi config set azure-native:location eastus2
-
Run
pulumi up
to preview and deploy changes: You must selecty
to continuepulumi up
Results
View Live: https://app.pulumi.com/shaht/azure-py-storage-account-networkrulesetresponseargs/dev/previews/c5d344d9-8b00-418f-9708-501359137da7 Type Name + pulumi:pulumi:Stack azure-py-storage-account-networkrulesetresponseargs-de + ├─ azure-native:resources:ResourceGroup resource_group + └─ azure-native:storage:StorageAccount sa Outputs: primary_storage_key: output<string> Resources: + 3 to create Updating (dev) View Live: https://app.pulumi.com/shaht/azure-py-storage-account-networkrulesetresponseargs/dev/updates/1 Type Name + pulumi:pulumi:Stack azure-py-storage-account-networkrulesetresponseargs-de + ├─ azure-native:resources:ResourceGroup resource_group + └─ azure-native:storage:StorageAccount sa Outputs: primary_storage_key: [secret] Resources: + 3 created Duration: 31s
-
View the outputs.
pulumi stack output
Results
Current stack outputs (1): OUTPUT VALUE primary_storage_key [secret]
If you need to see the values for the primary key of the storage account, you will have to do the following
pulumi stack output --show-secrets
-
Clean up
pulumi destroy -y
-
Remove. This will remove the Pulumi.dev.yaml file also
pulumi stack rm dev -y