| title | Alternatives for self-hosting developer portal |
|---|---|
| titleSuffix | Azure API Management |
| description | Learn about alternative approaches you can use when you self-host a developer portal in Azure API Management. |
| author | dlepow |
| ms.author | danlep |
| ms.date | 02/02/2025 |
| ms.service | azure-api-management |
| ms.topic | how-to |
[!INCLUDE api-management-availability-premium-dev-standard-basic-premiumv2-standardv2-basicv2]
There are several alternative approaches you can explore when you self-host a developer portal:
- Use production builds of the designer and the publisher.
- Use an Azure Function App to publish your developer portal.
- Front the files of your developer portal with a content delivery network to reduce page loading times.
This article provides information on each of these approaches.
If you haven't already done so, set up a local environment for the latest release of the developer portal.
If you want to host the development environment of the developer portal online for collaboration purposes, use production builds of the designer and the publisher. Production builds bundle the files and exclude source maps.
Create a bundle in the ./dist/designer directory by running the command:
npm run build-designerThe result is a single page application, so you can still deploy it to a static web host, such as the Azure Blob Storage Static Website.
Similarly, place a compiled and optimized publisher in the ./dist/publisher folder:
npm run build-publisherRun the publishing step in the cloud as an alternative to running it locally.
To implement publishing with an Azure Function App, you need the following prerequisites:
- Create an Azure Function. The Function needs to be a JavaScript language Function.
- Install Azure Functions Core Tools:
npm install -g azure-function-core-tools
Uploading the content directly to the hosting website instead of a local folder. This location is the $web container of output storage. Configure this change in the ./src/config.publish.json file:
{
...
"outputBlobStorageContainer": "$web",
"outputBlobStorageConnectionString": "DefaultEndpointsProtocol=...",
...
}There's a sample HTTP Trigger Function in the ./examples folder. To build it and place it in ./dist/function, run the following command:
npm run build-functionThen, sign in to the Azure CLI and deploy it:
az login
cd ./dist/function
func azure functionapp publish <function app name>
After you deploy it, you can invoke it with an HTTP call:
curl -X POST https://<function app name>.azurewebsites.net/api/publishIn self-host a developer portal, we suggest using an Azure storage account to host your website. However, you can publish the files through any solution, including services of hosting providers.
You can also front the files with a content delivery network to reduce page loading times. We recommend using Azure Content Delivery Network.
Learn more about the developer portal: