Skip to content

Latest commit

 

History

History

azure-py-rg-storageaccounts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Azure Resource Group and Storage Account

Deploys Azure Resource Group and Storage Account in Python

Deployment

  1. Initialize a new stack called dev via pulumi stack init.

    pulumi stack init dev
  2. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

    az login
  3. 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
  4. Set the confi 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
  5. Run pulumi up to preview and deploy changes: You must select y to continue

    pulumi up

    Results

    Previewing update (dev)
    
    View Live: https://app.pulumi.com/myuser/azure-py-rg-storageaccounts/dev/updates/4
    
        Type                                     Name                             Status      
    +   pulumi:pulumi:Stack                      azure-py-rg-storageaccounts-dev  created     
    +   ├─ azure-native:resources:ResourceGroup  demo-resource_group              created     
    +   └─ azure-native:storage:StorageAccount   demosa                           created     
    
    Outputs:
        primary_storage_key : "[secret]"
        resource_group_name : "demo-resource_groupc02a8864"
        storage_account_id  : "[secret]"
        storage_account_name: "demosa0e5062ba"
    
    Resources:
        + 3 created
    
    Duration: 29s
  6. View the outputs created via pulumi stack output

    pulumi stack output

    Results

    Current stack outputs (4):
    OUTPUT                VALUE
    primary_storage_key   [secret]
    resource_group_name   demo-resource_groupc02a8864
    storage_account_id    [secret]
    storage_account_name  demosa0e5062ba

    If you need to see the values that are secret, you will have to do the following

    pulumi stack output --show-secrets
  7. Clean up.

    pulumi destroy -y
  8. Remove the stack. This will remove the Pulumi.dev.yaml file also

    pulumi stack rm dev