Azure API Management is a fully managed service to publish, secure, transform, maintain, and monitor APIs, API Management handles all the tasks involved in mediating API calls, including request authentication and authorization, rate limit and quota enforcement, request and response transformation, Mocking logging and tracing, and API version management.
Azure API Management has 3 Main components.
- The API gateway is the endpoint that:
- Accepts API calls and routes them to your back ends.
- Verifies API keys, JWT tokens, certificates, and other credentials.
- Enforces usage quotas and rate limits.
- Transforms your API on the fly without code modifications.
- Caches backend responses where set up.
- Logs call metadata for analytics purposes.
- The Azure portal is the administrative interface to
- Define or import API schema.
- Package APIs into products.
- Set up policies like quotas or transformations on the APIs.
- Get insights from analytics.
- Manage users.
- The Developer portal serves as the main web presence for developers or end-users, where they can:
- Read API documentation.
- Try out an API via the interactive console.
- Create an account and subscribe to get API keys.
- Access analytics on their own usage
In My organization , we use Developer portal instead of Swagger for API definitions and it works great for us.
Let’s Create API management using Azure portal
- Login to Azure, go to Create a Resource, select Integration -> API Management.
- This opens the API Management Creation blade. Fill out all the information and pick a appropriate pricing tier,
- More information on tiers – https://azure.microsoft.com/en-us/pricing/details/api-management/
- Note – Virtual network integration is supported on in Developer or Premium tier.
- monitoring tab, Select App insights in Monitoring, I would highly recommend turning this feature on.
- Scale tab, Developer and consumption tier doesn’t offer scaling.
- Managed identity, assign identity for APIM to access other resources.
- Virtual Network, select external or internal to deploy APIM inside virtual network, APIM is access over internet in external type and accessible only internally in internal type , default it none.
- Protocol settings, APIM supports multiple versions of TLS protocol for both client and backend.
- Enter tags and review and create, it takes some time for APIM to deploy, be patient 🙂
Import an Azure Function App as a new API
- Navigate to APIM service that is created above in the Azure portal and select APIs from the menu.
- In the Add a new API list, select Function App.
- Click Browse to select Functions for import.
- Click on the Function App section to choose from the list of available Function Apps.
- Find the Function App to import Functions from, click on it and press Select.
- Select the Functions you would like to import and click Select.
Note – You can import only Functions that are based off HTTP trigger and have the authorization level setting set to Anonymous or Function
Test the new API in the Azure portal
You can call API operations directly from the Azure portal, which provides a convenient way to view and test the operations.
- In the left navigation of APIM instance, select APIs -> Apimanagement-fa.
- Select the Test tab, and then select getUsers. The page shows Query parameters and Headers, if any. The Ocp-Apim-Subscription-Key is filled in automatically for the subscription key associated with this API.
- Select Send.
APIM is great very powerful tools to create consistent and modern API gateways for existing back-end services,we will learn more about APIM in future posts.
Intro to Azure API ManagementTweet
One thought on “Intro to Azure API Management Service (APIM)”