Azure API management service is used to create a consistent and modern API gateways for existing back-end services. It provides secure, scalable API Access for your application.
In this blog you will learn how to manage the ASP.NET Core Web APIs with Azure API Management service.
Azure API Management Components:
API Gateway Capabilities:
- Accept API calls and routes them to your backend
- Verifies API Keys, JWT tokens, Certificates, and other credentials
- Enforce usage quotas and rate limits
- Cache backend responses
Azure Portal Capabilities:
- Define or import API Schema
- Set up policies like quotas or transformations on the APIs
- Packing APIs into products
- Manage users
Developer Portal Capabilities:
- Read API documentation
- Create an account and subscribe to get API Keys
- Try out an API via the interactive console
- Access analytics
Other main topics related to Azure API Management are,
- Versions and
Versions allow to present group of related APIs to the developers, you can use versions to handle breaking changes in your API safely.
Revisions allow you to make changes to the APIs in a controlled and safe way without disturbing your API consumers.
“Each version can have multiple revisions, just like a non-versioned API. You can use revisions without using versions, or the other way around”
“Versions are used to separate API versions with breaking changes, while revisions can be used for minor and non-breaking changes to an API”.
Create Azure Management Services using Azure portal
Login to azure portal
Search for Azure management service.
Click on Azure management service as shown in below figure
Fill all the mandatory fields as shown in below figure and click on review+create. It will create an API Management instance
The Resource name should be unique.
Go to newly create API Management service and click on APIs blade
Click on Add API and select Open API, as shown in below figure.
I have already created some open APIs using ASP.NET Core Web API, and the swagger page as shown below.
Click on/swagger/v1/swagger.json to get a APIs schema information.
Copy that URL and paste it in Open API specification. The Display name and Name are prepopulated. Finally click on create. It will create a new API production as shown in below figure.
From the list of APIs, I have selected, get all cities API for testing, click on Test tab to test the API.
We have learned about the basics of Azure API Management service and it’s API gateway and Azure portal capabilities and finally we have integrated the ASP.NET Core APIs with our existing Azure API Management service and tested the End point using Azure portal.