Get Azure Resource Group Info With Ansible

In the previous blog posts, we have covered how to create resources on Microsoft Azure with Ansible, and this post will show you how to retrieve information from Azure with Ansible.


Sometimes you might need to retrieve information from Azure without using the portal or CLI. This post will show how to display resource group information and all the resources that are in the resource group with Ansible.


The playbook below will display all the information that belongs to a resource group called WSL and all the resources inside it. No changes will be made to the resource group or resources.

- name: Get info about Azure subscription
  hosts: localhost
  connection: local
    - name: Get facts for one subscription by name
        name: WSL
        list_resources: yes