Created
February 14, 2023 14:15
-
-
Save kek-Sec/352e637886d9e0792d575cd0f50fd591 to your computer and use it in GitHub Desktop.
container app + application insights linking
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
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