1
votes

I'm looking for a straightforward and maintanable way to set up a CI/CD pipeline for Azure API Management.

Let's say, for each release, I can automatically generate the OpenAPI spec from the code. How can I build on this OpenApi spec to set up Azure API Management with all required version sets, apis, products, tags, users, subscriptions, certificates, and policies?

I've found Azure DevOps toolkit but it has bugs, does not provide all features, and is not easy and flexible enough to be integrated with CI/CD pipeline.

1

1 Answers

2
votes

There is a less well-known cross-platform tool called dotnet-apim.

It's forked from Microsoft's Apim DevOps Toolkit but there are added many other functionalities such as:

  1. Support for Tags, Users, Subscriptions, Certificates, and Api Subscription Key
  2. Support for defining the name of generated ARM templates
  3. Support for variables and conditional statements
  4. Support for defining the Ids of all APIM entities
  5. Some of the bugs are eliminated. For example, Microsoft's toolkit cannot deploy multiple apis that are defined using OpenApi Spec.

On top of all these benefits, the toolkit is now packaged as a cross platform dotnet global tool. So, you can easily add a task in your ci/cd pipeline to install dotnet and dotnet-apim in one shot. Then you can easily call the tool to generate required ARM templates for you.

dotnet tool install --global Apim.DevOps.Toolkit  #installs the tool
dotnet-apim -c "c:/apim/definition.yml" #generates arm templates

The tool's Github page provides a detailed explanation. Examples are also included to illustrate different scenarios.

The Variables and Conditional Statements provide a lot of flexibility to support complex scenarios.