Showing posts with label Azure Monitoring Agent. Show all posts
Showing posts with label Azure Monitoring Agent. Show all posts

Sunday, October 17, 2021

Azure Monitoring Agent extension for VMSS- Updating through ARM template

 You can add multiple extensions to Azure VMSS  through the extensionProfile of ARM template. The below script shows the extension configuration and mapping workspaceId to collect custom logs from VMSS instances.


{
                "name""AxMAExtension",
                "properties": {
                  "autoUpgradeMinorVersion"true,
                  "protectedSettings": {
                    "workspaceKey""[listKeys(resourceId(parameters('RGName'),'Microsoft.OperationalInsights/workspaces/', parameters('workspacename')),'2015-11-01-preview').primarySharedKey]"
                  },
                  "publisher""Microsoft.Azure.Monitor",
                  "settings": {
                    "workspaceId""[reference(resourceId(parameters('RGName'),'Microsoft.OperationalInsights/workspaces/', parameters('workspacename')), '2015-11-01-preview').customerId]"
                  },
                  "type""AzureMonitorWindowsAgent",
                  "typeHandlerVersion""1.0"
                }
              }