node.js - 如何从azure事件网格主题获取数据

标签 node.js azure azure-functions azure-eventgrid

如何从azure事件网格主题获取数据

我已使用 NodeJS 中的主题访问 key 和主题端点将数据添加到 azure 事件网格主题

如何使用 NodeJS 读取主题中的数据

最佳答案

  • 据我所知,NodeJS azure 函数事件网格触发器是一种从事件网格获取事件的方法。

  • 首先创建一个事件网格,并在事件网格中创建主题。还要在 Azure 门户中创建一个函数应用。

  • 现在,在fucntions选项卡中单击create,将出现一个弹出窗口,然后在模板列表中选择``并单击create

enter image description here

  • 现在,在出现的新窗口中,单击Integration,然后单击Event Grid Trigger(eventGridEvent),之后将出现一个弹出窗口,其中单击 >创建事件网格订阅

enter image description here

  • 将出现一个新窗口,您应在其中填写表单中的所有详细信息,例如名称、事件网格名称、订阅名称、资源组等。 enter image description here

我的函数代码:

module.exports = async  function (context, eventGridEvent) {
    context.log(typeof eventGridEvent);
    context.log(eventGridEvent);
};

  • 现在,每当将事件添加到事件网格时,触发器都会接收到该事件,您可以在其中根据业务逻辑添加进一步的计算。

这里我发送了两个由事件网格触发函数接收的事件。

enter image description here

关于node.js - 如何从azure事件网格主题获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74861017/

相关文章:

azure - 以编程方式停止 azure 函数

javascript - Firestore 一次创建多个文档

javascript - 在 GruntJS 任务中使用 ‘this.files’ 时出现问题

javascript - 如何动态地将项目添加到接受对象列表的函数中

azure - 是否可以仅使用用户 ID 和密码来获取 Azure token ?

ios - Windows Azure 分页数据

Azure Function VNet 集成随机中断

c# - 加密 Azure Function 中的服务总线连接字符串

javascript - Vue 2 : How to render Single File Components from Render Functions?

oauth-2.0 - Dotnet 隔离的 Azure Functions - 如何访问 HttpContext