Skip to content

Commit

Permalink
Merge branch 'main' into feat/introduce-actor-entity
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Digdir.Domain.Dialogporten.Application/Externals/IDialogDbContext.cs
#	src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommand.cs
  • Loading branch information
Fargekritt committed Feb 27, 2025
2 parents 377cf4c + e6d3f2e commit b6a0244
Show file tree
Hide file tree
Showing 375 changed files with 17,723 additions and 3,568 deletions.
4 changes: 2 additions & 2 deletions .azure/applications/graphql/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ var tags = {
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
2 changes: 1 addition & 1 deletion .azure/applications/graphql/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.5'
param otelTraceSamplerRatio = '0.0'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
4 changes: 2 additions & 2 deletions .azure/applications/service/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ var tags = {
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
2 changes: 1 addition & 1 deletion .azure/applications/service/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param appConfigurationName = readEnvironmentVariable('AZURE_APP_CONFIGURATION_NA
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
param serviceBusNamespaceName = readEnvironmentVariable('AZURE_SERVICE_BUS_NAMESPACE_NAME')

param otelTraceSamplerRatio = '0.5'
param otelTraceSamplerRatio = '0.0'

// secrets
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var tags = {
}
var name = '${namePrefix}-sync-rp-info'

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var tags = {
}
var name = '${namePrefix}-sync-sr-mappings'

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
17 changes: 11 additions & 6 deletions .azure/applications/web-api-eu/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ var tags = {
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down Expand Up @@ -104,15 +104,15 @@ var containerAppEnvVars = [
@description('The scaling configuration for the container app')
param scale Scale = {
minReplicas: 2
maxReplicas: 10
maxReplicas: 20
rules: [
{
name: 'cpu'
custom: {
type: 'cpu'
metadata: {
type: 'Utilization'
value: '70'
value: '50'
}
}
}
Expand Down Expand Up @@ -141,6 +141,7 @@ var probes = [
{
periodSeconds: 5
initialDelaySeconds: 2
timeoutSeconds: 3
type: 'Liveness'
httpGet: {
path: '/health/liveness'
Expand All @@ -149,7 +150,9 @@ var probes = [
}
{
periodSeconds: 5
initialDelaySeconds: 2
initialDelaySeconds: 20
timeoutSeconds: 3
failureThreshold: 6
type: 'Readiness'
httpGet: {
path: '/health/readiness'
Expand All @@ -158,7 +161,9 @@ var probes = [
}
{
periodSeconds: 5
initialDelaySeconds: 2
initialDelaySeconds: 10
timeoutSeconds: 3
failureThreshold: 6
type: 'Startup'
httpGet: {
path: '/health/startup'
Expand Down
2 changes: 1 addition & 1 deletion .azure/applications/web-api-eu/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.5'
param otelTraceSamplerRatio = '0.0'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
2 changes: 1 addition & 1 deletion .azure/applications/web-api-migration-job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var tags = {
}
var name = '${namePrefix}-db-migration-job'

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
4 changes: 2 additions & 2 deletions .azure/applications/web-api-so/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ var tags = {
Product: 'Dialogporten'
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' existing = {
resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2024-10-02-preview' existing = {
name: containerAppEnvironmentName
}

Expand Down
2 changes: 1 addition & 1 deletion .azure/applications/web-api-so/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.5'
param otelTraceSamplerRatio = '0.0'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
10 changes: 9 additions & 1 deletion .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ param sshJumperAdminLoginGroupObjectId string
@description('The URL of the APIM instance')
param apimUrl string

@description('Whether to purge data immediately after 30 days in Application Insights')
param appInsightsPurgeDataOn30Days bool = false

import { Sku as KeyVaultSku } from '../modules/keyvault/create.bicep'
param keyVaultSku KeyVaultSku

Expand All @@ -59,6 +62,8 @@ param postgresConfiguration {
storage: PostgresStorageConfig
enableIndexTuning: bool
enableQueryPerformanceInsight: bool
enableHighAvailability: bool
backupRetentionDays: int
}

import { Sku as ServiceBusSku } from '../modules/serviceBus/main.bicep'
Expand All @@ -85,7 +90,7 @@ var tags = {
}

// Create resource groups
resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-03-01' = {
resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-11-01' = {
name: '${namePrefix}-rg'
location: location
tags: tags
Expand Down Expand Up @@ -121,6 +126,7 @@ module appInsights '../modules/applicationInsights/create.bicep' = {
location: location
sku: appInsightsSku
tags: tags
immediatePurgeDataOn30Days: appInsightsPurgeDataOn30Days
}
}

Expand Down Expand Up @@ -210,6 +216,8 @@ module postgresql '../modules/postgreSql/create.bicep' = {
enableQueryPerformanceInsight: postgresConfiguration.enableQueryPerformanceInsight
subnetId: vnet.outputs.postgresqlSubnetId
vnetId: vnet.outputs.virtualNetworkId
enableHighAvailability: postgresConfiguration.enableHighAvailability
backupRetentionDays: postgresConfiguration.backupRetentionDays
tags: tags
}
}
Expand Down
2 changes: 2 additions & 0 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ param postgresConfiguration = {
}
enableIndexTuning: false
enableQueryPerformanceInsight: false
enableHighAvailability: true
backupRetentionDays: 32
}

param redisSku = {
Expand Down
2 changes: 2 additions & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ param postgresConfiguration = {
}
enableIndexTuning: true
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
}

param redisSku = {
Expand Down
2 changes: 2 additions & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ param postgresConfiguration = {
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
}

param redisSku = {
Expand Down
4 changes: 4 additions & 0 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ param environment = 'yt01'
param location = 'norwayeast'
param keyVaultSourceKeys = json(readEnvironmentVariable('AZURE_KEY_VAULT_SOURCE_KEYS'))

param appInsightsPurgeDataOn30Days = true

param redisVersion = '6.0'

// secrets
Expand Down Expand Up @@ -36,6 +38,8 @@ param postgresConfiguration = {
}
enableIndexTuning: true
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
}

param redisSku = {
Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/appConfiguration/addReaderRoles.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param appConfigurationName string
param principalIds array

resource appConfig 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfig 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/appConfiguration/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ param sku Sku
var appConfigNameMaxLength = 63
var appConfigName = uniqueResourceName('${namePrefix}-appConfiguration', appConfigNameMaxLength)

resource appConfig 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
resource appConfig 'Microsoft.AppConfiguration/configurationStores@2024-05-01' = {
name: appConfigName
location: location
sku: sku
Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/appConfiguration/upsertKeyValue.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ param tags object = {}
var parsedContentType = keyValueType == 'keyVaultReference' ? 'application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8' : keyValueType == 'featureFlag' ? 'application/vnd.microsoft.appconfig.ff+json;charset=utf-8' : contentType
var parsedValue = keyValueType == 'keyVaultReference' ? '{"uri":"${value}"}' : value

resource configStore 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource configStore 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: configStoreName
resource configStoreKeyValue 'keyValues' = {
name: key
Expand Down
6 changes: 6 additions & 0 deletions .azure/modules/applicationInsights/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param location string
@description('Tags to apply to resources')
param tags object

@description('Whether to purge data immediately after 30 days in Application Insights')
param immediatePurgeDataOn30Days bool

@export()
type Sku = {
name:
Expand All @@ -28,6 +31,9 @@ resource appInsightsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-
name: '${namePrefix}-insightsWorkspace'
location: location
properties: {
features: {
immediatePurgeDataOn30Days: immediatePurgeDataOn30Days
}
retentionInDays: 30
sku: sku
workspaceCapping: {
Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/containerAppEnv/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource appInsightsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-
name: appInsightWorkspaceName
}

resource containerAppEnv 'Microsoft.App/managedEnvironments@2024-02-02-preview' = {
resource containerAppEnv 'Microsoft.App/managedEnvironments@2024-10-02-preview' = {
name: '${namePrefix}-cae'
location: location
identity: {
Expand Down
2 changes: 1 addition & 1 deletion .azure/modules/keyvault/copySecrets.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resource srcKeyVaultResource 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
scope: resourceGroup(srcKeyVaultSubId, srcKeyVaultRGNName)
}

resource appConfigurationResource 'Microsoft.AppConfiguration/configurationStores@2023-03-01' existing = {
resource appConfigurationResource 'Microsoft.AppConfiguration/configurationStores@2024-05-01' existing = {
name: appConfigurationName
}

Expand Down
31 changes: 18 additions & 13 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ param enableIndexTuning bool
@description('The name of the Application Insights workspace')
param appInsightWorkspaceName string

@description('Enable high availability')
param enableHighAvailability bool

@description('The number of days to retain backups. If not specified, the default value of 7 days will be used.')
@minValue(7)
@maxValue(35)
param backupRetentionDays int

@description('The Key Vault to store the PostgreSQL administrator login password')
@secure()
param srcKeyVault object
Expand All @@ -65,19 +73,6 @@ var databaseName = 'dialogporten'
var postgresServerNameMaxLength = 63
var postgresServerName = uniqueResourceName('${namePrefix}-postgres', postgresServerNameMaxLength)

// Uncomment the following lines to add logical replication.
// see https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logical#pre-requisites-for-logical-replication-and-logical-decoding
//var postgresqlConfiguration = {
// //wal_level: 'logical'
// //max_worker_processes: '16'

// // The leading theory is that we are using pgoutput as the replication protocol
// // which comes out of the box in postgresql. Therefore we may not need the
// // following two lines.
// //'azure.extensions': 'pglogical'
// //shared_preload_libraries: 'pglogical'
//}

module saveAdmPassword '../keyvault/upsertSecret.bicep' = {
name: 'Save_${srcKeyVaultAdministratorLoginPasswordKey}'
scope: resourceGroup(srcKeyVault.subscriptionId, srcKeyVault.resourceGroupName)
Expand All @@ -99,6 +94,11 @@ module privateDnsZone '../privateDnsZone/main.bicep' = {
}
}

var highAvailabilityConfig = enableHighAvailability ? {
mode: 'ZoneRedundant'
standbyAvailabilityZone: '2'
} : null

resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
name: postgresServerName
location: location
Expand All @@ -111,6 +111,10 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
autoGrow: storage.autoGrow
type: storage.type
}
backup: {
backupRetentionDays: backupRetentionDays
geoRedundantBackup: 'Disabled'
}
dataEncryption: {
type: 'SystemManaged'
}
Expand All @@ -119,6 +123,7 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
delegatedSubnetResourceId: subnetId
privateDnsZoneArmResourceId: privateDnsZone.outputs.id
}
highAvailability: highAvailabilityConfig
}
sku: sku
resource database 'databases' = {
Expand Down
Loading

0 comments on commit b6a0244

Please sign in to comment.