This is an old revision of the document!
AZURE_OPENAI_ENDPOINT, DEPLOYMENT_ID, and API_KEY correctly referenced.localhost:3978.docker build -t <image> ..containerapp-params.json.az bicep build.AppContainerAppConsoleLogs_CL \\ | where ContainerAppName_s == "<your-container-app-name>"\\ | sort by TimeGenerated desc
AppContainerAppConsoleLogs_CL | where Log_s contains "500" | summarize Count = count() by bin(TimeGenerated, 5m)
param containerAppResourceId string
param logAnalyticsWorkspaceId string
param actionGroupId string
@description('Create CPU High Usage Alert')
resource cpuAlert 'Microsoft.Insights/metricAlerts@2018-03-01' = {
name: 'cpu-high-usage'
location: 'global'
properties: {
description: 'Alert when CPU usage exceeds 80%'
severity: 3
enabled: true
scopes: [containerAppResourceId]
evaluationFrequency: 'PT1M'
windowSize: 'PT5M'
criteria: {
allOf: [
{
metricName: 'cpuUsagePercentage'
metricNamespace: 'Microsoft.App/containerApps'
operator: 'GreaterThan'
threshold: 80
timeAggregation: 'Average'
}
]
}
actions: [
{
actionGroupId: actionGroupId
}
]
}
}
@description('Create Memory High Usage Alert')
resource memoryAlert 'Microsoft.Insights/metricAlerts@2018-03-01' = {
name: 'memory-high-usage'
location: 'global'
properties: {
description: 'Alert when memory usage exceeds 75%'
severity: 3
enabled: true
scopes: [containerAppResourceId]
evaluationFrequency: 'PT1M'
windowSize: 'PT5M'
criteria: {
allOf: [
{
metricName: 'memoryWorkingSetBytes'
metricNamespace: 'Microsoft.App/containerApps'
operator: 'GreaterThan'
threshold: 75
timeAggregation: 'Average'
}
]
}
actions: [
{
actionGroupId: actionGroupId
}
]
}
}