微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何使用 Azure 警报负载来触发 azure 函数的 HTTP

如何解决如何使用 Azure 警报负载来触发 azure 函数的 HTTP

我正在尝试使用 Azure 警报在调用 Azure 函数时发送的负载

def main(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')
    req_body = req.get_json()
    print(req_body)

但在 req_body 变量中没有得到任何东西。 任何人都知道如何在 python azure 函数中使用它。

解决方法

如果要使用azure alert触发Azure Function,请参考以下步骤

  1. 创建 Azure 函数。我的代码如下
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
    )
  1. 创建提醒

    一个。定义条件

    B.定义操作组 enter image description here

  2. 测试 enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。