C# Azure Function trigger when SQL Database has a new row added without polling(当 SQL 数据库添加新行而不进行轮询时,C# Azure 函数触发器)
问题描述
有没有办法在每次将新的数据库行添加到 SQL azure 数据库时调用 Azure 函数?理想情况下没有任何基于计时器的轮询.我知道这可以在 blob 存储上完成,但在 Azure 函数上看不到这样做的方法.
Is there a way for an Azure function to be called every time a new database row is added to an SQL azure database ? Ideally without any timer based polling. I know this can be done on blob storage but dont see a way to do this on Azure function.
提前致谢
推荐答案
这是可能的,但现在是实验性的.我在这个答案的末尾有一个指南,你会发现它非常简单.但同样,这是实验性的,不要指望它一直都能正常工作.
It is possible but it's experimental right now. There's a guide that I'm putting at the end of this answer and you'll see that it's pretty straight forward. But again, this is experimental and don't expect that it works well all the time.
另一个选项将在您拥有的代码中插入一条记录以向服务总线队列发送消息,然后您可以将其用作函数的触发器(使用服务总线,您还可以配置死信等待重试).
Another option will be in the code you have that insert a record to also send a message to queue o service bus and you can then make use of that as a trigger to your function (with service bus you also configure a dead letter queue for retries).
参考:https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-external-table
这篇关于当 SQL 数据库添加新行而不进行轮询时,C# Azure 函数触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:当 SQL 数据库添加新行而不进行轮询时,C# Azure 函数触发器
基础教程推荐
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
