In this session, Frank is creating an Azure Automation for one of the Azure Power Tool. The one that automatically deletes “expired” resources inside our Azure Subscription. Once fully created and functional, he will export the ARM template to look at what kind of resources he will need in the deployment of that solution.



  • 00:00:01 - Bonjour, Hi!
  • 00:00:44 - Recap the project.
  • 00:09:42 - Create the Automation RunBook.
  • 01:30:36 - Add code in the script to delete empty Resources Group
  • 01:48:17 - Export ARM Template


  • List expired resources
  • List empty Resource Groupes
  • delete expired resources
  • Sent notification with list of expired resources
  • capture any errors that might happen


  • Create an easy way to add tags
  • Create an ARM template to deploy
  • Clean-up/Structure the GitHub to make sens of the 3 “tools”

New Subscribers


Streams Notes/ Snipets/ Shared urls

This query return the resources that are expired

  • az graph query -q ‘where todatetime(tags.expireOn) > now() project name, type, expireOn=tostring(tags.expireOn) limit 5’
  • We need to add module
    • Az.Accounts
    • Az.ResourceGraph


  • GitHub Project: