[英]Is it possible to create a topic subscription in an azure function app?
I do know we can create a subscription in ASB, but I wanted to know if the subscription does not exist, can we create one in the azure function app itself?我知道我们可以在 ASB 中创建订阅,但我想知道如果订阅不存在,我们可以在 azure function 应用程序本身中创建一个吗? To give more context, if there is a topic trigger in my function app, I want to check if the subscription exists or not.
为了提供更多上下文,如果我的 function 应用程序中有主题触发器,我想检查订阅是否存在。 If it does, it uses it, but if not needs to create a new one.
如果是,则使用它,但如果不是,则需要创建一个新的。
That'd be a chicken and egg situation.那将是先有鸡还是先有蛋的情况。 The entity has to be there for a function to be triggered by an entity (queue or subscription on a topic).
该实体必须存在,才能由实体(主题上的队列或订阅)触发 function。 Otherwise, there's no message to receive that would trigger the function in the first place.
否则,没有消息会首先触发 function。
You can work around it by running during Function's initial start-up, but that's not something that is supported by the Functions service natively.您可以通过在 Function 的初始启动期间运行来解决它,但这不是 Functions 服务本身支持的功能。 In my post I show how to achieve that using
FunctionsStartup
(In-Proc SDK).在我的帖子中,我展示了如何使用
FunctionsStartup
(In-Proc SDK)实现这一点。 A similar approach could be used with the Isolated Worker SDK.类似的方法可以用于孤立的工作人员 SDK。
You can also express your interest in the feature to be provided by Functions if you'd like by letting the team know .如果您愿意,也可以通过让团队知道来表达您对 Functions 提供的功能的兴趣。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.