You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/developer-portal-integrate-application-insights.md
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure API Management
4
4
description: Learn how to integrate Application Insights into your managed or self-hosted developer portal.
5
5
author: dlepow
6
6
ms.author: danlep
7
-
ms.date: 03/25/2021
7
+
ms.date: 08/16/2022
8
8
ms.service: api-management
9
9
ms.topic: how-to
10
10
---
@@ -18,7 +18,7 @@ A popular feature of Azure Monitor is Application Insights. It's an extensible A
18
18
Follow these steps to plug Application Insights into your managed or self-hosted developer portal.
19
19
20
20
> [!IMPORTANT]
21
-
> Steps 1 and 2 are not required for managed portals. If you have a managed portal, skip to step 4.
21
+
> Steps 1 -3 are not required for managed portals. If you have a managed portal, skip to step 4.
22
22
23
23
1. Set up a [local environment](developer-portal-self-host.md#step-1-set-up-local-environment) for the latest release of the developer portal.
24
24
@@ -28,23 +28,33 @@ Follow these steps to plug Application Insights into your managed or self-hosted
28
28
npm install @paperbits/azure --save
29
29
```
30
30
31
-
1. In the `startup.publish.ts` file in the `src` folder, import and register the Application Insights module:
31
+
1. In the `startup.publish.ts` file in the `src` folder, import and register the Application Insights module. Add the `AppInsightsPublishModule` after the existing modules in the dependency injection container:
32
32
33
33
```typescript
34
34
import { AppInsightsPublishModule } from "@paperbits/azure";
1. Retrieve the portal's configuration using the [Content Item - Get](/rest/api/apimanagement/current-ga/content-item/get) REST API:
40
44
41
45
```http
42
-
GET /contentTypes/document/contentItems/configuration
46
+
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.ApiManagement/service/{api-management-service-name}/contentTypes/document/contentItems/configuration?api-version=2021-08-01
"title": "Microsoft Azure API Management - developer portal",
@@ -55,17 +65,23 @@ Follow these steps to plug Application Insights into your managed or self-hosted
55
65
}
56
66
}
57
67
]
68
+
}
58
69
}
59
70
```
60
71
61
-
1. Extend the site configuration from the previous step with Application Insights configuration:
72
+
1. Extend the site configuration from the previous step with Application Insights configuration. Update the configuration using the [Content Item - Create or Update](/rest/api/apimanagement/current-ga/content-item/create-or-update) REST API. Pass the Application Insights instrumentation key in an `integration` node in the request body.
73
+
62
74
63
75
```http
64
-
PUT /contentTypes/document/contentItems/configuration
76
+
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.ApiManagement/service/{api-management-service-name}/contentTypes/document/contentItems/configuration?api-version=2021-08-01
@@ -76,9 +92,12 @@ Follow these steps to plug Application Insights into your managed or self-hosted
76
92
}
77
93
}
78
94
]
95
+
}
79
96
}
80
97
```
81
98
99
+
1. After you update the configuration, [republish the portal](api-management-howto-developer-portal-customize.md#publish) for the changes to take effect.
0 commit comments