How to create a alert if someone is disabling any function from my function app?

Bharvi Bhut 181 Reputation points
2023-05-16T07:24:45.2866667+00:00
  1. I have created one function app "XYZ".
  2. Inside this function app I have created 2 functions "F1" and "F2".
  3. Now I want to create an alert or notification if user is disabling any function(F1 or F2).

Can someone please help how I can solve this requirement?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,826 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,321 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AirGordon 7,105 Reputation points
    2023-05-16T08:08:07.7533333+00:00

    Fortunately the action of disabling a function causes an Azure Activity Log to be written; ("entity": "/subscriptions/subscriptionid/resourceGroups/gyourRG/providers/Microsoft.Web/sites/yourfunctionapp/functions/yourfunction/properties/state")

    User's image

    Because of this, you can create an alert in the event that someone disables your function.
    https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-logic-apps?tabs=send-email
    I'd encourage you to check your function app's Activity Log and find out who's been disabling your functions 🤪

    The other thing i'd consider is locking down who has access to your resource group, or even deny assignments