Azure APIM to Event Grid via VNet Integration

Syed Sajid Hussain 41 Reputation points
2023-12-21T18:20:36.6533333+00:00

We have the following setup.

  • Azure APIM v2 Standard
  • Azure Event Grid Basic with Private endpoint only access enabled

This is what we have done so far:

  • Created a private endpoint for Event Grid and blocked public access to it
  • Enabled VNet Integration on our APIM v2 Standard instance, this uses the same VNet as the Event Grid but a separate dedicated Subnet
  • When we try to publish messages from APIM to Event Grid, it fails with the following error.

inputEventsCount=null, requestUri=https://**.eventgrid.azure.net/api/events, publisherInfo=publisherName=.EVENTGRID.AZURE.NET, category=User, inputSchema=EventGridEvent, armResourceId=*, filteringPolicy:DnsHost, emitAuditLogs=True, drBoundary=WithinGeopair, regionCategory=Primary, isPublishBlockedDueToDr=False, httpStatusCode=Forbidden, errorType=ClientIPRejected, errorMessage=Publishing to *.EVENTGRID.AZURE.NET by client 20.108.108.60 is rejected due to IpAddress filtering rules. For troubleshooting, visit https://aka.ms/egpublisherrorcode403.

  • If we enable the Public access on Event Grid, this works fine

Question is, are we missing anything that we need to do to make it to work with private endpoint? If not, is that a bug in v2 Standard APIM?

Please note that we are able to publish and get messages from Event Grid with private endpoint enabled to Logic App, which also uses VNet Integration, so the problem seems to be at the APIM end.

Regards

Syed

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
{count} votes

Answer accepted by question author
  1. MuthuKumaranMurugaachari-MSFT 22,446 Reputation points Moderator
    2024-01-04T18:50:45.8033333+00:00

    Update for the community:

    Syed Sajid Hussain followed doc: Integrate with VNET for outbound requests in configurating VNET for APIM instance and enabled private endpoints for event grid as described in the doc. Performed nslookup from the VNET for the event grid point and it pointed to the private endpoint correctly but gateway logs from APIM showed public IP.

    The configuration was not saved correctly in APIM, and we are investigating to find the cause of the issue.

    Resolution:

    Syed Sajid Hussain mitigated the issue by removing VNET/Subnet from the APIM and then added it back again. After that, it started working as expected.

    Glad to hear that your issue was resolved and appreciate you sharing it with the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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