Create a Storage Account on Microsoft Azure With Ansible

This blog post will show you how to create a storage account on Microsfost Azure using Ansible and the Azure module.

Before you start, you will need to authenticate to Azure using a credential file or Azure CLI. Once you are authenticated, you can run the playbook and create the storage account.

Create a storage account

The below code will create a storage account in the Ubuntu-resources Resource group, and it will use a standard replication.

- name: Create a storage account on Microsoft Azure
  hosts: localhost
  connection: local
  gather_facts: yes
  tasks:
    - name: Create storage account
      azure_rm_storageaccount:
        resource_group: ubuntu-resources
        name: testaccountnrw001
        account_type: Standard_LRS

The above playbook is also available in our Github repository.

Processing…
Success! You're on the list.

Posted

in

by