Skip to content

Files

Latest commit

eca6f24 · Sep 17, 2021

History

History
88 lines (69 loc) · 2.93 KB

developer-portal-integrate-application-insights.md

File metadata and controls

88 lines (69 loc) · 2.93 KB
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

Integrate Application Insights to developer portal

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.

Add Application Insights to your 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.

  1. Set up a local environment for the latest release of the developer portal.

  2. Install the npm package to add Paperbits for Azure:

    npm install @paperbits/azure --save
  3. In the startup.publish.ts file in the src folder, import and register the Application Insights module:

    import { AppInsightsPublishModule } from "@paperbits/azure";
    ...
    injector.bindModule(new AppInsightsPublishModule());
  4. 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"
                }
            }
        ]
    }
  5. 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"
                    }
                }
            }
        ]
    }

Next steps

Learn more about the developer portal: