简体   繁体   中英

Set a monitoring alert for all the slots of an azure app

The title says it all.

I have some azure apps with 3 to 4 deployment slots each, I want to set monitoring alerts for server errors for all of them by making a somekind of global alert rule instead of define a rule for each slot and app. Is it possible?

As we know, we could use the Azure portal, PowerShell or the Command Line Interface etc to create alerts rule to monitor Azure resource metrics, events or logs. And we need to specify the Resource ID for the resource that we want to set and alert for, and different resources with different Resource ID, so we could not create a global alerts rule for monitoring all of our web apps and slots.

Resource ID may look like this.

Web app:

"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/YourResourceGroupName/providers/Microsoft.Web/sites/websitename"

Web app slot:

"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/YourResourceGroupName/providers/Microsoft.Web/sites/websitename/slots/slotname"

Azure Monitor alerts are limited to one single Azure resource only. If you like to go deeper and define alert rules for multiple Azure resources, you can use Log Analytics to collect data from several Azure resources and create one alert rule for multiple services.

In a nutshell:

  1. Stream data from Azure monitor to Log Analytics into the OMS workspace, see Data sources in log analytics 在此处输入图片说明
  2. Create and alert in Log Analytics once 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM