1

How to get data from azure event grid topic

I have added data to azure event grid topic using topic access key and topic endpoint from NodeJS

how can I read the data in topic using NodeJS

Jesse Squire
  • 6,107
  • 1
  • 27
  • 30

1 Answers1

0
  • As far as I know for NodeJS azure function event grid trigger is a way to get the events from the event grid.

  • So first of all create an event grid , and topic in the event grid . Also create a function app in azure portal.

  • Now in the fucntions tab click on create a pop will appear and then select `` in the list of templates and click create

enter image description here

  • Now in the new window which will appear click on Integration and then click on Event Grid Trigger(eventGridEvent) after that a popup will appear in which click on create Event Grid subscription

enter image description here

  • A new window will appear where you should fill all the details in the form such as name, event grid name, subscription name, resource group etc. enter image description here

my function code :

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

  • Now whenever an event is added to event grid it will be received by the trigger where you can add further computation according to your business logic.

Here I have sent two event which are received by the event grid trigger function.

enter image description here

Mohit Ganorkar
  • 1,917
  • 2
  • 6
  • 11