简体   繁体   English

如何在 Azure Monitor Alert 上配置操作组以使用可编译(C# 或 F#) Azure Function

[英]How to configure Action Group on Azure Monitor Alert to use compilable (C# or F#) Azure Function

I was trying to figure out how to configure Action Group to use Azure Function .我试图弄清楚如何配置操作组以使用 Azure Function Documentation says that:文档说:

Calls an existing HTTP trigger endpoint in Azure Functions.在 Azure 函数中调用现有的 HTTP 触发端点。

You may have a limited number of Function actions in an Action Group.一个操作组中的 Function 操作可能数量有限。

So what I tried already:所以我已经尝试过:

  • C# script file created on the portal - works在门户网站上创建的 C# 脚本文件 -有效
  • Powershell script created on the portal - works在门户网站上创建的 Powershell 脚本 -有效
  • Powershell script deployed to Azure Function - works Powershell 脚本部署到 Azure Function -工作
  • compiled Function App in C# deployed to Azure Function - doesn't work编译 Function 应用程序在 C# 部署到 Azure Z86408593C34AF77FDD1Z60DF932F8B52不工作
  • compiled Function App in F# deployed to Azure Function - doesn't work已编译 Function 应用程序在 F# 部署到 Azure Z86408593C34AF727FDD90DF932FZ8不起作用

My preference is actually to use F# here and this is the reason why I'm trying to figure out (I know that I can use fsx and then it probably goes fine, however I want use compiled app and if it is not possible know why)我的偏好实际上是在这里使用 F# 这就是我试图弄清楚的原因(我知道我可以使用 fsx 然后它可能会很好,但是我想使用编译的应用程序,如果它不可能知道为什么)

Each app I tested calling and endpoint from postman and each time it was fine.我测试的每个应用程序都从 postman 调用和端点,每次都很好。 I tried also Function and Anonymous AuthorizationLevel.我也试过 Function 和匿名授权级别。

And by saying that action doesn't work I mean following:通过说该行动不起作用,我的意思是遵循:

  • no evidence of calling that function (on Azure Function or App Insights)没有证据表明 function (在 Azure Function 或 App Insights 上)
  • no error or warning regardless the side无论在哪一边都没有错误或警告

I also tried to configure a Webhook action by putting Azure Function endpoint but it also doesn't work.我还尝试通过放置 Azure Function 端点来配置 Webhook 操作,但它也不起作用。 Did you understand why it is happening like this?你明白为什么会这样吗?

I figure out that and the issue was that in compilable version I didn't handle post verb.我弄清楚了,问题是在可编译版本中我没有处理post动词。 After adding it, all works as expected.添加后,一切都按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM