Automate developer portal deployments

The developer portal in Azure API Management supports programmatic access to content. The developer portal allows you to import data to, or export from, an API Management service through the content management REST API. The REST API access works for both managed and self-hosted developer portals.

Automated migration script

You can automate the migration of content between two API Management services, for example, a service in the test environment and a service in the production environment. The scripts.v3/migrate.js script in the developer portal GitHub repo simplifies this automation process.

Warning

The script removes the contents of the developer portal in your destination API Management service. If you're concerned about it, make sure you perform a backup.

Note

Using the script to migrate developer portal content between an API Management instance in a classic tier (for example, Standard).

Note

If you're using a self-hosted developer portal with an explicitly defined custom storage account to host media files (that is, you define the blobStorageUrl setting in the config.design.json configuration file), you need to use the original scripts.v2/migrate.js script. The original script doesn't work for managed or self-hosted portals with the media storage account managed by API Management. In that case, use the script from the /scripts.v3 folder instead.

The script performs the following steps:

  1. Captures the portal content and media from the source API Management service.
  2. Removes the portal content and media from the destination API Management service.
  3. Uploads the portal content and media to the destination API Management service.
  4. Optionally and for managed portals only: automatically publishes the portal.

After the script runs successfully, the target API Management service should contain the same portal content as the source service and you'll be able to see it as an administrator.

  • If you're using a managed portal, you can set the script to autopublish the destination portal to make the migrated version automatically available to visitors.
  • If you're using a self-hosted portal, you need to publish the destination portal manually. Follow the publishing and hosting instructions in the tutorial to set up a self-hosted developer portal.