当 SQL 数据库添加新行而不进行轮询时,C# Azure 函数触发器

C# Azure Function trigger when SQL Database has a new row added without polling(当 SQL 数据库添加新行而不进行轮询时,C# Azure 函数触发器)

本文介绍了当 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 函数触发器

基础教程推荐