Created
August 18, 2020 21:21
-
-
Save matt-FFFFFF/4ff131ef565d991501da743434b444fa to your computer and use it in GitHub Desktop.
azure-apim-appinsights.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"name": { | |
"type": "String" | |
}, | |
"location": { | |
"type": "String" | |
}, | |
"adminEmail": { | |
"type": "String" | |
}, | |
"orgName": { | |
"type": "String" | |
}, | |
"tier": { | |
"type": "String" | |
}, | |
"capacity": { | |
"type": "Int" | |
}, | |
"loggerName": { | |
"type": "String" | |
}, | |
"appInsightsId": { | |
"type": "String" | |
} | |
}, | |
"resources": [ | |
{ | |
"type": "Microsoft.ApiManagement/service", | |
"apiVersion": "2019-12-01", | |
"name": "[parameters('name')]", | |
"location": "[parameters('location')]", | |
"sku": { | |
"name": "[parameters('tier')]", | |
"capacity": "[parameters('capacity')]" | |
}, | |
"properties": { | |
"publisherEmail": "[parameters('adminEmail')]", | |
"publisherName": "[parameters('orgName')]" | |
}, | |
"resources": [ | |
{ | |
"type": "loggers", | |
"apiVersion": "2019-12-01", | |
"name": "[parameters('loggerName')]", | |
"dependsOn": [ | |
"[concat('Microsoft.ApiManagement/service/', parameters('name'))]" | |
], | |
"properties": { | |
"loggerType": "applicationInsights", | |
"resourceId": "[parameters('appInsightsId')]", | |
"credentials": { | |
"instrumentationKey": "[reference(parameters('appInsightsId'), '2015-05-01').InstrumentationKey]" | |
} | |
} | |
}, | |
{ | |
"type": "diagnostics", | |
"apiVersion": "2019-12-01", | |
"name": "applicationinsights", | |
"dependsOn": [ | |
"[concat('Microsoft.ApiManagement/service/', parameters('name'))]", | |
"[concat('Microsoft.ApiManagement/service/', parameters('name'), '/loggers/', parameters('loggerName'))]" | |
], | |
"properties": { | |
"loggerId": "[concat('/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/', parameters('name'), '/loggers/', parameters('loggerName'))]", | |
"alwaysLog": "allErrors", | |
"sampling": { | |
"percentage": 100, | |
"samplingType": "fixed" | |
} | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment