Skip to content

Commit

Permalink
ci: add application insights and create container app env
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Mar 20, 2024
1 parent d6a94e2 commit a5de669
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .azure/applications/bff-migration-job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ param environmentKeyVaultName string

var namePrefix = 'dp-fe-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-frontend-'
var containerAppJobName = '${namePrefix}-bff'
var containerAppJobName = '${namePrefix}-bff-migration-job'

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
name: appConfigurationName
Expand Down
10 changes: 10 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ module appInsights '../modules/applicationInsights/create.bicep' = {
}
}

module containerAppEnv '../modules/containerAppEnv/main.bicep' = {
scope: resourceGroup
name: 'containerAppEnv'
params: {
namePrefix: namePrefix
location: location
appInsightWorkspaceName: appInsights.outputs.appInsightsWorkspaceName
}
}

// Create references to existing resources
resource srcKeyVaultResource 'Microsoft.KeyVault/vaults@2022-11-01' existing = {
name: secrets.sourceKeyVaultName
Expand Down
21 changes: 11 additions & 10 deletions .azure/modules/applicationInsights/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ param namePrefix string
param location string

resource appInsightsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: '${namePrefix}-insightsWorkspace'
location: location
name: '${namePrefix}-insightsWorkspace'
location: location
}

resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
name: '${namePrefix}-applicationInsights'
location: location
kind: 'web'
properties: {
Application_Type: 'web'
WorkspaceResourceId: appInsightsWorkspace.id
}
name: '${namePrefix}-applicationInsights'
location: location
kind: 'web'
properties: {
Application_Type: 'web'
WorkspaceResourceId: appInsightsWorkspace.id
}
}

output connectionString string = appInsights.properties.ConnectionString
output connectionString string = appInsights.properties.ConnectionString
output appInsightsWorkspaceName string = appInsightsWorkspace.name

0 comments on commit a5de669

Please sign in to comment.