For much of the work we do, we end up with APIs in the cloud. In the .NET world, this often means hosting a WebAPI in the cloud. With WebAPIs, we usually have endpoints that are accessible to anyone who can connect to the API.
These APIs can have other requirements such as authentication, scalability, throttling, etc. Instead of building all those features into our applications, we can just use Azure’s API Management and have a lot of that hard work already done for us.
In this blog post, we will quickly set up an API Management layer on top of an Azure Function API. We have other posts that cover Azure Functions, so here we will assume we already have an Azure Function solution created.
We will start by publishing that solution from within Visual Studio by right-clicking on the Azure Function project and then clicking “Publish”.
After the Azure Function solution is published and running in Azure, we can find it within the Azure Portal.
Next, go to “All Resources” in the Azure Portal and add an API Management resource.
After creating the API Management resource, you need to add your Azure Function API to this Resource. To do this, navigate to your API Management Resource and then click “APIs”.
Click “+ Add API” and then import your Function application.
Now API Management is linked to your Function application, and your API is running in the cloud. Really, that’s all it takes.
If you have any questions or comments, hit me up on Twitter or sound off in the comments below.