title | titleSuffix | description | author | ms.author | ms.date | ms.service | ms.topic |
---|---|---|---|---|---|---|---|
Integrate Application Insights to developer portal |
Azure API Management |
Learn how to integrate Application Insights into your managed or self-hosted developer portal. |
dlepow |
danlep |
03/25/2021 |
api-management |
how-to |
A popular feature of Azure Monitor is Application Insights. It's an extensible Application Performance Management (APM) service for developers and DevOps professionals. Use it to monitor your developer portal and detect performance anomalies. Application Insights includes powerful analytics tools to help you learn what users actually do while visiting your developer portal.
Follow these steps to plug Application Insights into your managed or self-hosted developer portal.
Important
Steps 1 and 2 are not required for managed portals. If you have a managed portal, skip to step 4.
-
Set up a local environment for the latest release of the developer portal.
-
Install the npm package to add Paperbits for Azure:
npm install @paperbits/azure --save
-
In the
startup.publish.ts
file in thesrc
folder, import and register the Application Insights module:import { AppInsightsPublishModule } from "@paperbits/azure"; ... injector.bindModule(new AppInsightsPublishModule());
-
Retrieve the portal's configuration:
GET /contentTypes/document/contentItems/configuration
{ "nodes": [ { "site": { "title": "Microsoft Azure API Management - developer portal", "description": "Discover APIs, learn how to use them, try them out interactively, and sign up to acquire keys.", "keywords": "Azure, API Management, API, developer", "faviconSourceId": null, "author": "Microsoft Azure API Management" } } ] }
-
Extend the site configuration from the previous step with Application Insights configuration:
PUT /contentTypes/document/contentItems/configuration
{ "nodes": [ { "site": { ... }, "integration": { "appInsights": { "instrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx" } } } ] }
Learn more about the developer portal: