API Management
API Management
The team had been managing this Web API project using .NET Core and OpenAPI Specification.
However, recently, the developers who consume these APIs have complained about API not working
as expected during updates. Also, managing and releasing new features to the Web API is getting
more challenging. I had discussed leveraging Azure API Management features to handle this situation
with our Solution Architect, and we decided to use its versioning capability to manage the changes. I
want to make it a practice to release a new version for breaking changes. Finally, I prefer to create
new revisions whenever any non-breaking changes are made to the API.
On the API Management services page, select your API Management instance.
Verify that the deployment is proper.
Delete test api and add api specification for weather api.
Import the latest OpenAPI specification of the BrezyWeather API to the Azure API Management
service instead of creating them manually. To do this, import the BrezyWeather-OpenAPI-v1.json file
in the newly created APIM instance. You can find this file in the Resources section.
You should see BrezyWeather API under the All APIs menu (1). Also, you will see the four
operations under the All operations section to its right (2).
Try to test it now.. You should get it 404 not found. Because your API management don’t
know about the Api you hosted in app service.
Configure the backend service for the API. To do this, click the Settings tab (1), enter the following
URL for the Web service URL field (2), and click the Save button (3).
Testing
Please navigate to the Design tab (1), click on the 2.0 version to ensure it is selected, and the API
operations point to version 2.0 (2).
Add the support for the DELETE operation for an individual forecast item. Since you aren't breaking
the existing API, you do not need to create a new version. However, to have a seamless change and
update, you need to use the Revisions feature of APIM. To do this, add a new revision, Revision 2,
before making the change.
Switch between revision 1 & 2 one will have delete and another not.