I am trying to consume the payload that azure alert is sending while calling an Azure function.
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
req_body = req.get_json()
print(req_body)
but not getting anything in req_body variable. Anyone on how to consume it in python azure function.
If you want to use azure alert to trigger Azure Function, please refer to the following steps
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
req_body = req.get_json()
logging.info(req_body)
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)