具有事件网格触发器绑定的函数应用程序 - Azure DevOps

Function App with Event Grid Trigger Binding - Azure DevOps

我希望有人能够指导我正确的方向。

我正在尝试执行以下操作:

事件网格 -> 函数应用 -> 存储账户

我也在尝试通过 ARM 模板和 Azure DevOps 部署来实现上述内容,但我对如何将事件网格绑定添加到 Azure Repos 中的函数应用程序 (.Net) 代码文件感到有些困惑。

我知道文档中说我需要安装 Microsoft.Azure.WebJobs.Extensions.EventGrid" NuGet 包,但这是如何通过 Azure DevOps 完成的?

目前我的发布管道设置如下:

1) 部署函数应用程序、存储帐户、事件网格 2) 部署函数应用代码 3) 获取函数应用的Master Key 4) 创建事件网格订阅。

任务 1-3 正确执行,但 (4) 失败并显示 "URL endpoint validation failed" - 我猜这是因为我没有在 Azure 存储库的函数文件中正确安装 Microsoft.Azure.WebJobs.Extensions.EventGrid 包。 当我手动设置所有内容并在门户中安装事件网格触发器时,我可以毫无问题地轻松创建事件网格订阅。

如果我的函数应用程序代码在 Azure Repos 中,我如何'install'事件网格在 Azure DevOps 中触发 NuGet 包?

非常感谢。

I know in the documentation it says that i need to install the Microsoft.Azure.WebJobs.Extensions.EventGrid" NuGet package, but how is this done through Azure DevOps?

正如中的回答,您需要添加一个dotnet restore任务来恢复包和一个.NET Core build任务来在存档文件之前构建扩展项目。

此外,我们可以安装和使用 Event Grid Subscription Extension 在 Azure DevOps 管道中创建和修改事件网格订阅。

以下博客供大家参考,希望对您有所帮助: