-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show Azure Monitor log config in aca-revisions
Signed-off-by: Kristina Devochko <[email protected]>
- Loading branch information
1 parent
29edc4e
commit 4fafe68
Showing
5 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
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
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
27 changes: 25 additions & 2 deletions
27
aca-revision-and-traffic-management/modules/aca-common.bicep
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
param location string | ||
param logAnalyticsWorkspaceId string | ||
param managedIdentityId string | ||
param tags object | ||
|
||
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-11-02-preview' = { | ||
name: 'cae-aca-store' | ||
name: 'cae-aca-helloworld' | ||
location: location | ||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${managedIdentityId}' : {} | ||
} | ||
} | ||
properties: { } | ||
properties: { | ||
appLogsConfiguration: { | ||
/* In this demo Azure Monitor is configured as ACA logs destination: https://learn.microsoft.com/en-us/azure/container-apps/log-options | ||
* If you would like to see how 'Log Analytics' option is configured, please check out ./aks-store-on-aca/modules/aca-common.bicep file | ||
*/ | ||
destination: 'azure-monitor' | ||
} | ||
} | ||
tags: tags | ||
} | ||
|
||
@description('Diagnostic setting for the ACA environment that\'s required when Azure Monitor is configured as logs destination.') | ||
resource acaEnvironmentDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = { | ||
name: containerAppsEnvironment.name | ||
scope: containerAppsEnvironment | ||
properties: { | ||
workspaceId: logAnalyticsWorkspaceId | ||
logs: [ | ||
{ | ||
categoryGroup: 'allLogs' | ||
enabled: true | ||
} | ||
] | ||
} | ||
} | ||
|
||
|
||
output defaultDomain string = containerAppsEnvironment.properties.defaultDomain | ||
output environmentId string = containerAppsEnvironment.id |
24 changes: 24 additions & 0 deletions
24
aca-revision-and-traffic-management/modules/azure-monitor.bicep
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param environment string | ||
param location string | ||
param managedIdentityId string | ||
param tags object | ||
|
||
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2022-10-01' = { | ||
name: 'log-aca-helloworld-${environment}' | ||
location: location | ||
identity: { | ||
type: 'UserAssigned' | ||
userAssignedIdentities: { | ||
'${managedIdentityId}' : {} | ||
} | ||
} | ||
properties: { | ||
retentionInDays: 30 | ||
sku: { | ||
name: 'PerGB2018' | ||
} | ||
} | ||
tags: tags | ||
} | ||
|
||
output logAnalyticsWorkspaceId string = logAnalytics.id |
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