Azure API Apps and API Management
The API apps features make it easy to develop, host, and consume APIs in the cloud and on-premises. The advantage of hosting APIs in Azure API apps is that we will get enterprise-grade security and simple access control, automatic SDK generation, and seamless integration with Logic Apps. Logic Apps are system workflows that you can build within Azure. And as a part of the workflow, each activity needs to interact with the functionality exposed by a different system. By having those interfaces hosted in Azure, it makes it easy to integrate with the logic apps also.
Features of API apps
- Bring our own existing API as-is: API can be developed in any language framework supported by App Service such as C#, Java, PHP, Node.js, etc.
- Easy Consumption: There is integrated support for Swagger API. By enabling swagger, we are making it easy for others to consume our APIs, and also we will provide excellent visibility of APIs to developers.
- Simple access control: Protect an API app from unauthenticated access with no changes to your code.
- Visual Studio Integration
- Integration with Logic apps
- API Management is all about managing APIs. We can put an API Management frontend on an API to monitor and throttle usage, manipulate input and output, consolidate several APIs into one endpoint, and so forth. The APIs being managed will be hosted anywhere.
- API Apps is about hosting APIs, whereas API management is about managing APIs. Let?s see how API management works.
At a very high level, firstly, when http or https request comes. It will come to API management and the API management based on the location of the API. Then it will forward that request to either Azure API apps or on-premises apps. But when it is forwarding that request it can throttle, it can also monitor and manipulate the inputs and outputs.
API Management portals
- The API management portal is where developers can learn about APIs, view and call operations, and subscribe to products.
- Content within the developer portal is modified via the publisher portal, which is accessible from the Azure portal. To reach there, click on the Publisher portal from the service toolbar of our API Management instance.
- The dashboard of the developer portal can be customized by adding custom content, customizing styles, and adding our branding.
API management concepts
The API management concept is the crucial thing that we need to remember.
- APIs and operations: Each API represents a set of actions available (might be CRUD operation) to developers.
- Products: This is how APIs are surfaced to developers. Each product can contain multiple APIs.
- Groups: It is used to manage the visibility of APIs so we can have three types of groups.
- An administrator group member can manage API management service instances, creating the APIs, operations, and products that are used by developers.
- Developers? group members are authenticated customers that build applications using APIs.
- Guests are the unauthenticated developer portal users. Guests are our prospective customers who will come and consume/trail. They will view the APIs and see whether it fits into their requirements or not.
- Policies: It is a very powerful capability of API management that allows the publisher to change the behavior of the API through configuration, such as throughput.
Creating an API using Azure Portal
Step 1: Click on create a resource. After that type in API apps and click on create.
Step 2: Now, assign a name to your API app and select the resource group. After that, select the service architecture according to your requirements.
Step 3: Finally, click on create.
Step 4: Your API app will be successfully created.
Publishing an API using Visual Studio
Step 1: Create a new web app project in Visual Studio. As shown in the following figure.
Step 2: Click on publish, then click on select existing. After that, click on the publish.
Step 3: Your web app is successfully posted to the Azure portal.