Similar to how we can create resources at scale using automation, we can also destroy those resources once we decide we don't need them. This is simplified with Ansible and the resource groups implemented by Azure – with a single API call with the correct parameters, we can decommission all the resources within a resource group that we have defined. In this recipe, we will outline how to perform this action to destroy all the resources we have provisioned so far.
Decommissioning Azure resources using Ansible
Getting ready
The Ansible control machine must be connected to the internet, with reachability to the Azure Public API endpoints. The Azure account should also be configured as outlined in the previous recipes...