Search code examples
pythonazureazure-functionsazure-alerts

Get Alert Notification when azure function returns code 200


I want to get notification when my azure function returns status 200. I have set up Alert and I am part of Action group that's supposed to receive alert.

Issue is, I am not getting alert. I checked Monitoring Graph for given signal aka HTTP 2XX, There also I see nothing.

I send this from code

            return func.HttpResponse(
                f"Total time took {time.time()-st}",
                status_code=200
            )

And My Azure portal looks like this azure portal screenshot


Solution

  • I want to get notification when my azure function returns status 200. I have set up Alert and I am part of Action group that's supposed to receive alert.

    I tried to create an notification alert for my function . When run my function if it returns 200 OK ,then it send me an mail notification of it.

    Here are steps:

    • Created an function with http trigger and create alert from function app > Alert >Create alert and add condition and action group and email /phone details to receive an notification .

    enter image description here

    Here is the configurations based on your requirement

    enter image description here

    • Settings inside alert in action added function :

    enter image description here

    • Run my function app and returned 200 status:

    enter image description here

    Here is the email notifications:

    enter image description here

    enter image description here

    For more information please refer this Blog & MS DOC .