Skip to content

Commit

Permalink
fix: add applicaation insights and aspnetcore environment
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Sep 5, 2024
1 parent c5d4a27 commit 77873e1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .azure/applications/sync-subject-resource-mappings-job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ param environmentKeyVaultName string
@minLength(9)
param jobSchedule string

@description('The connection string for Application Insights')
@minLength(3)
@secure()
param appInsightConnectionString string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/digdir/dialogporten-'
var tags = {
Expand All @@ -46,6 +51,14 @@ var containerAppEnvVars = [
name: 'Infrastructure__DialogDbConnectionString'
secretRef: 'dbconnectionstring'
}
{
name: 'ASPNETCORE_ENVIRONMENT'
value: environment
}
{
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: appInsightConnectionString
}
]

// https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-deployment#example-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ param jobSchedule = '*/5 * * * *' // Runs every 5 minutes
//secrets
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ param jobSchedule = '*/5 * * * *' // Runs every 5 minutes
//secrets
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ param jobSchedule = '*/5 * * * *' // Runs every 5 minutes
//secrets
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
1 change: 1 addition & 0 deletions .github/workflows/action-deploy-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ jobs:
# secrets
AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
with:
scope: resourcegroup
template: ./.azure/applications/${{ matrix.name }}/main.bicep
Expand Down

0 comments on commit 77873e1

Please sign in to comment.