Azure offers developers the ability to build and host their APIs in the cloud. As Mobile phones take over PC sales, it has become more important for developers to build and deploy REST API services which both Mobile Phones and Tablets can connect to. Azure App Services provides the Paas environment to accomplish this.
If you need a scalable, secure platform to build your API’s then Azure API Apps will meet your requirements. You can develop your API’s using multiple languages such as Python, C# or even PHP. You can select from a selection of web frameworks such as Node JS, ASP.net Web API and more. If you develop using Visual Studio you get integration through project templates and deployment wizards. Azure API Apps can also be used for integration scenarios to leverage workflows using Azure Logic Apps.
Azure API Apps are hosted using Azure App Services offering. This means they share common features that are offered for Web Apps. These include:
Swagger is an API documentation framework. With swagger API developers can build documentation using metadata. If you are building an Azure Api App in Visual Studio, then the API App project template will add the Swagger Nuget references to the project. Once you deploy your API app to Azure you can access the Swagger UI using the URL: https://websitedomainname/swagger.
Azure API Apps also supports continuous deployment from your source control system. You can then use Azure App Service deployment slots to deploy your changes to a staging area. This allows developers to pre-qualify changes before they are promoted to production.
If you wish to federate your authentication, then API Apps can be configured to use the following as Identity Providers:
By default, your API app will be configured with no authentication method. Azure Active Directory allows you to use OAuth to protect your API.
Visual Studio 2017 provides an API project template. From Visual Studio File Menu select New Project
Once your application has been deployed you can visit it at the URL: https://{appname}.azurewebsites.net ({appname} is what you named your app in the deployment wizard)
As mentioned earlier Visual Studio adds the necessary code and references to enable Swagger. But to be sure check if the option to enable the Swagger API UI is enabled. You will find this in the file SwaggerConfig.cs This is automatically created as part of the project template. Make sure the line:.EnableSwaggerUi(c => Is not commented.
If you wish to interrogate your Swagger documentation you can go to the url: https://{appname}.azurewebsites.net/swagger/
You can start integrating your API App with a Logic App. For example, you could have a scenario where you have a workflow which requires data from your API.
Before you can do this you have to configure the following via the Azure Portal:
See the following screenshots:
Once you have done these steps you can start integrating your Logic App with your API!
Azure API App Services provides an easy and configurable solution for building and deploying API Apps into the Cloud. It provides developers flexibility in terms of programming languages and Web frameworks. You can also use the core features of App Services such as Auto scaling, deployment slots and continuous integration and deployment. For security you can configure Azure AD, or federate with a Social Media Identity provider. if you are building workflows using Azure Logic Apps you can now use Swagger endpoint to integrate your Api App with your workflow.