0
votes

I'm looking to set up a CI/CD flow for the content in the developer portal, so we can make changes in our dev environment and promote them to higher environments. From what I found, this appears to have information on the suggested way to perform this:

https://docs.microsoft.com/en-us/azure/api-management/automate-portal-deployments

which links to this repo:

https://github.com/Azure/api-management-developer-portal

As far as I can tell, the majority of the code in that repository. is for the developer portal itself in case you wanted to self host. I'm not interested in self hosting, I'm only interested in the scripts contained there, as they will allow me to extract and publish the content between environments. Is there a repository with ONLY the code required for the scripts to run (specifically v3)? I'd prefer to avoid manually going through and deleting files that are non-script related if possible, as I don't really know/understand what they all are.

If such a repository existed, it would enable my ideal scenario which would be to fork that repository, run the "capture" script, then check the extracted developer portal content in to the new repository.

1

1 Answers

0
votes

Well, so why don't you just copy the scripts.v3 folder and use it? As you noticed you don't need rest files if you are not running self hosted version. So you can just simply copy paste them. Those scripts are nothing more than a client for Azure REST API endpoints written in node.js. And they can run completely independently from the rest of the repository.


If you don't like node.js you can even write your own scripts to deploy developer portal - with languange of your choice.

Developer portal contains Content Types which contain Content Items. One extra thing is media (fonts, images etc.) that are stored in the APIM blob storage. Those two things determinate how Developer Portal looks like.

So all you need to do is:

  1. Grab all content items (using Azure REST API) from one instance and put them to another APIM
  2. Connect to APIM blob storage and grab all media blobs and put them to another APIM blob storage. You can get SAS url to the blob storage using Azure REST API as well.

And if you examine carefully, those scripts are doing exactly the same thing:

  • capture.js - will take all files from given APIM instance and put it in to your local folder
  • generate.js - will take files from your local folder and put it to APIM instance of your choice
  • migrate.js - is just a combination of previous two scripts. It will take files from one instance and put it to another.
  • cleanup.js - it is the same thing like reset button in developer portal. It brings back the default state.