Skip to content

Instantly share code, notes, and snippets.

@kek-Sec
Created February 14, 2023 14:15
Show Gist options
  • Save kek-Sec/352e637886d9e0792d575cd0f50fd591 to your computer and use it in GitHub Desktop.
Save kek-Sec/352e637886d9e0792d575cd0f50fd591 to your computer and use it in GitHub Desktop.
container app + application insights linking
resource appInsights 'Microsoft.Insights/components@2021-05-01-preview' = {
name: '<your-appinsights-name>'
location: '<location>'
properties: {}
}
resource containerApp 'Microsoft.ContainerInstance/containerGroups@2021-11-01' = {
name: '<your-containerapp-name>'
location: '<location>'
dependsOn: [
appInsights
]
properties: {
containers: [
{
name: '<your-container-name>',
properties: {
image: '<your-container-image>',
ports: [
{
port: 80
}
],
environmentVariables: [
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY',
value: appInsights.properties.InstrumentationKey
}
]
}
}
],
osType: 'Linux',
ipAddress: {
type: 'Public',
ports: [
{
protocol: 'tcp',
port: 80
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment