How to get azure Eventgrid custom event data using Go language ?

Koushik Purva Mahendra 50 Reputation points
2023-05-10T12:40:34.8933333+00:00

I want a Go language code that can print the custom event data coming from the azure eventgrid, which is I am using as trigger to hit my azure function apps function.

We have the reference for all other languages but not for go language.

I want a solution kind of this "https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-grid-trigger?pivots=programming-language-python&tabs=csharp-script%2Cextensionv3" but in Go language.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,931 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
456 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-05-10T20:30:01.2433333+00:00

    Koushik Purva Mahendra Thanks for posting your question in Microsoft Q&A. The official supported languages are listed here, and we provide examples in our doc for those languages. The languages that are not officially supported can use custom handlers to implement and we provide some basic examples in the repo: functions-custom-handlers (not specific examples for each service though; will pass feedback to our product team for adding more samples).

    You can follow doc Azure Functions custom handlers and configure event grid bindings in function.json similar to other languages, use code snippets in this repo to handle the incoming requests. The flow is when event grid event data is received, Functions host sends an HTTP POST request to the custom handler with the payload in the request body and you can process the data from the body with your business logic.

    Here is the sample code snippet:

    handler.go

    User's image

    host.json

    User's image

    function.json

    User's image

    I hope this helps and let me know if you have any questions.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.