Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 61449d5

Browse files
authored
Merge pull request #54 from mike-urnun-msft/cxpcommunity
AI integration
2 parents 9818f65 + ffa1ff2 commit 61449d5

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

example/diagnostics/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Integration: Application Insights
2+
3+
This ARM template integrates an existing API Management instance to new Application Insights instance.
4+
5+
**Instructions:**
6+
1. Clone this repo
7+
2. Using a command-line tool, navigate to the `example/diagostics` directory
8+
3. Run following Azure CLI command to start the process:
9+
10+
`az group deployment create --resource-group <resource-group> --template-file ./application-insights.template.json --parameters ApimServiceName=<apim-instance-name> --parameters @application-insights.parameters.json`
11+
12+
Note: be sure to replace `<resource-group>`as well as `<apim-instance-name>` with their corresponding parameters and update the `application-insights.parameters.json` file with appropriate parameters that pertain to your environment.
13+
4. Once completed, your existing API Management instance should be integrated with a newly created Application Insights instance as described in: [How to integrate Azure API Management with Azure Application Insights](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema":
3+
"http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
4+
"contentVersion": "1.0.0.0",
5+
"parameters": {
6+
"ApplicationInsightsLocation": {
7+
"value": "westus2"
8+
},
9+
"ApplicationInsightsInstanceName": {
10+
"value": "contoso-appinsights"
11+
},
12+
"SamplingRate": {
13+
"value": 50
14+
}
15+
}
16+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"ApimServiceName": {
6+
"type": "string"
7+
},
8+
"ApplicationInsightsLocation": {
9+
"type": "string"
10+
},
11+
"ApplicationInsightsInstanceName": {
12+
"type": "string"
13+
},
14+
"SamplingRate": {
15+
"type": "int"
16+
}
17+
},
18+
"variables": {},
19+
"resources": [
20+
{
21+
"name": "[parameters('ApplicationInsightsInstanceName')]",
22+
"type": "Microsoft.Insights/components",
23+
"apiVersion": "2015-05-01",
24+
"location": "[parameters('ApplicationInsightsLocation')]",
25+
"tags": {},
26+
"kind": "other",
27+
"properties": {
28+
"Application_Type": "other"
29+
}
30+
},
31+
{
32+
"type": "Microsoft.ApiManagement/service/loggers",
33+
"name": "[concat(parameters('ApimServiceName'), '/', parameters('ApplicationInsightsInstanceName'))]",
34+
"apiVersion": "2018-06-01-preview",
35+
"properties": {
36+
"loggerType": "applicationInsights",
37+
"description": "Logger resources to APIM",
38+
"credentials": {
39+
"instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('ApplicationInsightsInstanceName')), '2015-05-01').InstrumentationKey]"
40+
}
41+
}
42+
},
43+
{
44+
"type": "Microsoft.ApiManagement/service/diagnostics",
45+
"name": "[concat(parameters('ApimServiceName'), '/applicationinsights')]",
46+
"apiVersion": "2018-06-01-preview",
47+
"properties": {
48+
"alwaysLog": "allErrors",
49+
"loggerId": "[concat('/loggers/', parameters('ApplicationInsightsInstanceName'))]",
50+
"sampling": {
51+
"samplingType": "fixed",
52+
"percentage": "[parameters('SamplingRate')]"
53+
},
54+
"frontend": {
55+
"request": {
56+
"headers": [],
57+
"body": {}
58+
},
59+
"response": {
60+
"headers": [],
61+
"body": {}
62+
}
63+
},
64+
"backend": {
65+
"request": {
66+
"headers": [],
67+
"body": {}
68+
},
69+
"response": {
70+
"headers": [],
71+
"body": {}
72+
}
73+
},
74+
"enableHttpCorrelationHeaders": false
75+
},
76+
"dependsOn": [
77+
"[resourceId('Microsoft.ApiManagement/service/loggers', parameters('ApimServiceName'), parameters('ApplicationInsightsInstanceName'))]"
78+
]
79+
}
80+
81+
]
82+
}

0 commit comments

Comments
 (0)