Delete a Microsoft Azure Resource Group With Ansible

This Ansible blog post will show you how to delete a Microsoft Azure resource group using an Ansible playbook.

In the previous posts, we learned a lot about Azure and Ansible, and this post will help with cleaning up resources.

The following playbook will delete all the resources in a resource group, including an empty resource group.


In the example below, all resources under the resource group WSL will be deleted permanently.

- name: Manage Microsft Azure
  hosts: localhost
  connection: local
  gather_facts: no
    - name: Delete a resource group
        name: WSL
        force_delete_nonempty: yes
        state: absent