How to publish eventgrid message to hosted web api?

Pankaj Jadhav 1 Reputation point
2021-06-18T13:04:18.473+00:00

Hi Team,

I have one service bus which receiving message on configured topic.

I am able to read published messages from service bus topic by using function app.

But now I have requirement where Event grid will have messages from service bus and event grid will publish those messages on my web api. (which hosted on aks).

Am totally new for event grid... can we have any reference codebase or documentation.

Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
435 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,891 Reputation points
    2021-06-21T06:56:12.333+00:00

    Hi @Pankaj Jadhav

    Welcome to Microsoft Q&A! Thanks for posting the question.

    Event grid are used for Event distribution (React to status changes) not for the messages. You can refer to compare messaging services for more details.
    If you want to leverage the event grid now the flow will be:
    Sender application sends message to service bus --> Create Event Grid subscription on your service bus resource (endpoint configured as webhook of AKS web API) --> AKS will have the web API that listens to the request and in web API you need to use service bus SDK to consume the message.

    Note: Service Bus Premium SKU is only supported with the eventgrid system topics.

    You can refer to similar document on azure function for Respond to Azure Service Bus events received via Azure Event Grid by using Azure Functions. Instead of azure function you need to create AKS webservice that will be used as webhook endpoint on your event grid subscription.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer 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.