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

查看:81
本文介绍了当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函数触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆