1

Topic.

I want to setup an alert when someone on my team updates a configuration in a function app. I could not find this in the docs. Is this possible?

JS noob
  • 429
  • 5
  • 14

3 Answers3

2

have a look at the Azure App Service as an Event Grid source

you can use an azure portal to subscribe for the eventType Microsoft.Web.AppUpdated and handle this event message in your properly subscriber, for instance: send the email, etc.

Roman Kiss
  • 7,925
  • 1
  • 8
  • 21
1

Azure Portal is down so can not provide more detailed answer right now. Will try to update it later.


You can "create log alert" if you're able to find a log message in Application Insights. You'll have to setup Function to send logs to Log Analytics.

Something like:

  • Go to your Function's logs (Logs at left bottom in Portal or your Log Analytics Workspace).
  • Find the right table that has Function App Activity events/logs.
  • Write appropriate query.
  • Click on Create Alert button above the query editor and follow steps.

If you've configured it to run say every 30 mins over last 30 min window, then Azure will just run that query on your logs every 30 minutes and if there are any hits (or not, depends on your alert configuration) it'll create an alert.

Kashyap
  • 15,354
  • 13
  • 64
  • 103
  • I am not sure hot to create a function that will send logs to analytics for an update to the function app configurations. – JS noob Mar 16 '21 at 18:16
  • @JSnoob See the links in post. It shows how to send logs to Log Analytics. Then look for events around the time of a deployment in Log Analytics and create alert. If relying on traces then you'll probably want: `traces | where operation_Name == ""` – Kashyap Mar 16 '21 at 20:14
  • I was able to do that. I just don't see any logs that show I changed a configuration in my function app. Ideally I would like it to show with configuration I changed in the function app. – JS noob Mar 16 '21 at 20:16
0

If the configuration of an AppService (or Function App) is changed, an event is created in the Activity Log. You can send these logs to Log Analytics and create an alert based on the entries.

https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log

Send the Activity log to a Log Analytics workspace to enable the features of Azure Monitor Logs which includes the following:

  • ...
  • Use log alerts with Activity entries allowing for more complex alerting logic.
Alex AIT
  • 17,361
  • 3
  • 36
  • 73