Search code examples
azurepowershellautomationazure-resource-managerbaseline

Azure ARM - Baseline resources with ARM template


I have created an ARM template for deploying resources into an Azure Resource Group. Is there any way I could use the same ARM template to perform automated "Baseline-Checks" in order to check if the resources have been changed in any way?


Solution

  • Are you just trying to determine if the state of the resources in Azure have "drifted" from the state declared in the template? If so you can use the what-if api and parse the results from that to see if something has changed.

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-what-if?tabs=azure-powershell

    If you want to prevent drift from occurring, you can lock the resources to prevent changes.

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources?tabs=json