-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(azure): connect cae to azure monitor (#1486)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> Related to #1485 ## Related Issue(s) - #1463 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced a new module for managing container app identities. - Enhanced monitoring configurations with new parameters for Application Insights and metrics ingestion. - Added functionality for assigning Monitoring Metrics Publisher roles to specified identities. - Introduced new resources for data collection endpoints and rules for improved monitoring capabilities. - **Improvements** - Updated existing modules to support new identity and monitoring features, enhancing overall deployment capabilities. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
5 changed files
with
155 additions
and
1 deletion.
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
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,17 @@ | ||
@description('The location where the resources will be deployed') | ||
param location string | ||
|
||
@description('The name of the managed identity') | ||
param name string | ||
|
||
@description('Tags to apply to resources') | ||
param tags object | ||
|
||
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
} | ||
|
||
output managedIdentityId string = managedIdentity.id | ||
output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
25 changes: 25 additions & 0 deletions
25
.azure/modules/monitor-workspace/addMetricsPublisherRoles.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,25 @@ | ||
@description('The name of the Monitor workspace') | ||
param monitorWorkspaceName string | ||
|
||
@description('Array of principal IDs to assign the Monitoring Metrics Publisher role to') | ||
param principalIds array | ||
|
||
resource monitorWorkspace 'Microsoft.Monitor/accounts@2023-04-03' existing = { | ||
name: monitorWorkspaceName | ||
} | ||
|
||
@description('This is the built-in Monitoring Metrics Publisher role. See https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#monitoring-metrics-publisher') | ||
resource monitoringMetricsPublisherRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = { | ||
scope: subscription() | ||
name: '3913510d-42f4-4e42-8a64-420c390055eb' | ||
} | ||
|
||
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for principalId in principalIds: { | ||
scope: monitorWorkspace | ||
name: guid(monitorWorkspace.id, principalId, monitoringMetricsPublisherRole.id) | ||
properties: { | ||
roleDefinitionId: monitoringMetricsPublisherRole.id | ||
principalId: principalId | ||
principalType: 'ServicePrincipal' | ||
} | ||
}] |
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