Can I setup an alert that will notify me when a configuration is updated in a function app?

633 Views Asked by At

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?

3

There are 3 best solutions below

0
Alex AIT On

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.
3
Kashyap On

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.

1
Roman Kiss On

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.