Introduction to Azure API Management Services
Tags: azure, api, architecture, apim
Published: 2022-05-05 14:26:03

#Introduction

The use of Application Programing Interface (API) are common nowadays for may reasons. Service exposure, integrations with third party organizations, modernizations, are some common use case of API's. Migrating a monolithic application to a distributed system such as microservices is also a common use case of API's. 

Figure 1 has an example of a monolithic application that interacts with a service layer and database. In many cases to expand the consumers of this application the creation of multiple services becomes necessary and the use of more than one API may also be necessary. 

| ![Monolithic and Distributed System](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ai9kswrw7zaihxr7xabc.png)|
|:--:|
| <b>Figure 1 - Monolithic and Distributed System</b>|

Therefore many organizations may choose to implement multiple API's   and expose them to multiple consumers. A distributed system in these cases may be a solution to contextualize API's as the business grows.

#Handling Multiple API's
The growth of the number of API's can cause more complexity in a sense of handling these API's. API's needs to be exposed and may have distinct end-points, they might have many types of authentication, caching and logging errors can be a difficult task.

| ![Handling multiple API's](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/916vbt5fhkgt2fkqd4xm.png)|
|:--:|
| <b>Figure 2 - Handling multiple API's </b>|


Figure 3 illustrates an example of 3 different API's with distinct authentication and end-points. Consuming these API's can create more complexity to the consumers due to many types of authentications and multiples end-point prefixes.

| ![Exposure and Authentication](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gcxbqltllpust44fjnb.png)|
|:--:|
| <b>Figure 3 - Exposure and Authentication </b>|

#Why Azure API Management
The use of Azure API Management (APIM) can facilitate the management of multiples API's within an organization. APIM acts as a proxy to multiple back-end API's. The consumers doesn't call the back-end API's directly, they call the APIM end-point and it routes back to the API's.

|![Azure API Management (APIM)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8c61udrgxnl83azio8d.png)|
|:--:|
| <b>Figure 4 - Azure API Management (APIM)|

## Benefits of APIM
There are several of benefits to using APIM:

1. It facilitates the client consumption to API's through portals and resources.
2. Allows Azure Active Directory integration for B2B and B2C.
3. Has throttling configuration to avoid the abuse of API calls.
4. Contains Policies with resources such as mocking, response caching, etc.

|![Benefits of APIM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkfb6uv286imwlrdkven.png)|
|:--:|
| <b>Figure 5 - Benefits of APIM|

## APIM Resources
The main resources available in APIM are the API Gateway, Azure Portal and Developer Portal. Figure 6 contains details of these resources.

|![APIM Resources](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mn07l4uo3u5u9upojyk.png)|
|:--:|
| <b>Figure 6 - APIM Resources|
 

### API Gateway, Azure Portal and Developer Portal

The API gateway Receives API requests and routes them to the back-end. It also Authenticate to the back-end API. It allows configurations such as limitations to API calls and cache responses from back-end API’s. Figure 7 contains some details of the routing from consumer to the back-end API's.

|![API Gateway](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e802atqfjhrvuoi7no6j.png)|
|:--:|
| <b>Figure 7 - API Gateway|

The azure portal allows you to Import and configure new API’s, Configure policies for the API’s, Setup user access and many other configurations.

The developer portal allows access to the API documentation. It enable login to account and access API Keys. It also permits testing the API's via web interface.

#Conclusion
There are many other configurations and resources that APIM has to offer such as products, subscriptions, groups, policies, etc. The goal of this introduction was to help you understand the basics of APIM and why some organizations might choose APIM as an API gateway.