Muokkaa

Jaa


Automate developer portal deployments

APPLIES TO: Developer | Basic | Basic v2 | Standard | Standard v2 | Premium | Premium v2

The API Management developer portal supports programmatic access to content. It 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 portals.

Automated migration script

You can use the API to automate 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 API Management developer portal GitHub repo simplifies this automation process.

Warning

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

Note

If you're using a self-hosted portal with an explicitly defined custom storage account to host media files (i.e., you define the blobStorageUrl setting in the config.design.json configuration file), you need to use the original scripts/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. Capture the portal content and media from the source API Management service.
  2. Remove the portal content and media from the destination API Management service.
  3. Upload the portal content and media to the destination API Management service.
  4. Optionally and for managed portals only - automatically publish the portal.

After the script is successfully executed, 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 auto-publish the destination portal to make the migrated version automatically available to the 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.

Next steps

Learn more about the developer portal: