在 Azure 数据工厂中完成 activity 后如何将消息发送到 Azure 服务总线

How do i send messages to Azure Service Bus after completion of activity in Azure data Factory

我正在尝试在 Azure 数据工厂管道中完成 activity 后通过 REST API 向 azure 服务总线发送消息。但是我如何生成访问令牌以在 Azure 数据工厂内发送消息。

Azure 数据工厂只有在网络上 activity 我可以通过它调用休息端点,是否有可能的解决方案。

我建议您可以为此使用 Azure Httptrigger 函数。

您可以使用 Azure httptigger 函数实现发送消息。并在 Azure 数据工厂中调用 Http 触发器函数。

关于Azure Httptrigger函数的更多信息,请参考这篇tutorial

然后我们可以使用 Web activity 从数据工厂管道调用 Azure 函数端点。

有一种方法可以使用 ADF Web activity 直接使用 ADF 的托管身份与服务总线 REST api 交互。

它需要为 ADF 的托管身份授予对服务总线命名空间的相关权限(例如,通过在 Web activity 中分配 Azure Service Bus Data Sender role). Rather than generating an access token, you can use the managed identity authentication 选项并将资源值设置为 https://servicebus.azure.net .

有关有效示例,请查看我的 blog post on sending messages to service bus from ADF