Azure API Management news at Ignite 2021: Event Grid, GraphQL and WebSockets

Ignite 2021 introduced at least three interesting updates to API Management: support for Event Grid, GraphQ, and WebSockets. I will try to cover the essence of the updates here.

API Management and Event Grid integration is now generally available

Event Grid is a notification service for Azure. A given service can publish updates to Event Grid and other services (e.g. an Azure Function) can listen to events and act upon them.

For API Management, the event grid integration supports a lot of practical scenarios, e.g.:

Scenario #1: custom validation logic for API subscriptions:

A user subscribes to an API via the Developer Portal. This triggers an event published to Event Grid. An Azure Function subscribes to the Event Grid and receives the subscription notification event. The Function can then implement some custom logic that validates some custom requirements (e.g. validates the e-mail domain or time-of-day) and can either reject or approve the subscription.

Scenario #2: send an e-mail to in-house/internal API developers when an API is updated

An API publisher updates an API. This triggers an event that is published to Event Grid. The event is then consumed by an Azure Function. The Function looks up API Management users that reside in the “InternalDevelopers” group and sends out an e-mail to its users.

Read more about the announcement here: General availability: API Management and Event Grid Integration

GraphQL pass-through in API Management

GraphQL is a very popular query language for web APIs used by GitHub and Twitter, amongst others. API Management allows you to manage, secure, test, and expose GraphQL services as APIs:

  1. You can manage GraphQL services as an API; either through the Azure Portal or the API Management’s management API.
  2. You can secure GraphQL services by using build-in security policies like access control and payload validation.
  3. You can test GraphQL APIs in the Development Portal and inspect the GraphQL schema.

Limitations

  • Currently only pass-through is supported. No rewriting of requests and responses.
  • One GraphQL API corresponds to one GraphQL backend endpoint. This is typically not an issue.

Preview

GraphQL pass-through support is currently in public preview.

Read the announcement here: Public preview: GraphQL passthrough support in Azure API Management and take a look at the Documentation.

Native support for WebSocket APIs is now generally available

WebSockets is a full-duplex communication protocol for the Web and is very popular in browser-based games. With WebSocket support in API Management, it is now possible to manage, secure, monitor, and test WebSocket APIs just like you would with REST APIs.

When you set up and configure WebSocket APIs things look a bit different. E.g. the WebSocket API has an onHandshake operation that allows you to intercept the handshake in API Management.

Limitations

  • WebSocket APIs are not supported yet in the Consumption tier and in the self-hosted gateway.
  • WebSocket APIs are not supported yet in the self-hosted gateway.
  • Besides the Azure Portal, only the REST API support management operations of WebSocket.

Read the announcement here: General availability: Native support for WebSocket APIs dive into the Documentation.

 

10