Forum Discussion

Sandeep_Poojary's avatar
Sandeep_Poojary
Copper Contributor
Jun 12, 2021
Solved

Diagnostics Settings Agent Deployment

 

I need to deploy the Diagnostics Settings across all the Azure Windows & Azure Linux Virtual Machines.

Manual is a tedious tasks,  Is there any option I can use automation to enable in across all the environment ?

 

 

  • PowerShell cmdlet: Set-AzDiagnosticSettings - could be a good place to start: https://docs.microsoft.com/en-us/powershell/module/az.monitor/set-azdiagnosticsetting?view=azps-6.0.0

    https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD

3 Replies

  • Hi Sandeep_Poojary ,

     

    I would recommend you leverage Azure Policies and the "policy-driven governance" recommended practice.

     

    There is a built-in policy initiative that can automatically deploy (deploy if not exist policy effect) both Azure Monitor Agent and Dependency agent on your Windows and Linux VMs running in Azure (and outside as well through Azure Arc).

     

    The initiative ID is /providers/Microsoft.Authorization/policySetDefinitions/55f3eceb-5573-4f18-9695-226972c6d74a. You can look it up in the Azure Policy blade and assign it to the scope you like (e.g. individual subscriptions or Management Groups).

  • PowerShell cmdlet: Set-AzDiagnosticSettings - could be a good place to start: https://docs.microsoft.com/en-us/powershell/module/az.monitor/set-azdiagnosticsetting?view=azps-6.0.0

    https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD
    • lukemurraynz's avatar
      lukemurraynz
      Learn Expert
      Also check out this Github repo for Azure Policy: https://github.com/JimGBritt/AzurePolicy/tree/master/AzureMonitor/Scripts