Skip to content

Commit

Permalink
fix(janitor): ensure Redis is configured correctly (#1182)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #{issue number}

## 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

- **New Features**
- Updated Redis configuration across all environments to require a
connection string instead of a boolean flag.
- Added placeholders for local secrets in production and staging
configurations.

- **Bug Fixes**
- Enhanced configuration clarity by removing deprecated properties and
introducing connection string requirements for Redis and database
connections.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
arealmaas authored Sep 24, 2024
1 parent e0c1cf2 commit 37fe982
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .azure/applications/sync-subject-resource-mappings-job/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ var containerAppEnvVars = [
name: 'Infrastructure__DialogDbConnectionString'
secretRef: 'dbconnectionstring'
}
{
name: 'Infrastructure__Redis__ConnectionString'
secretRef: 'redisconnectionstring'
}
{
name: 'DOTNET_ENVIRONMENT'
value: environment
Expand All @@ -61,13 +65,19 @@ var containerAppEnvVars = [
}
]

// Base URL for accessing secrets in the Key Vault
// https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-deployment#example-1
var keyVaultUrl = 'https://${environmentKeyVaultName}${az.environment().suffixes.keyvaultDns}/secrets/dialogportenAdoConnectionString'
var keyVaultBaseUrl = 'https://${environmentKeyVaultName}${az.environment().suffixes.keyvaultDns}/secrets'

var secrets = [
{
name: 'dbconnectionstring'
keyVaultUrl: keyVaultUrl
keyVaultUrl: '${keyVaultBaseUrl}/dialogportenAdoConnectionString'
identity: 'System'
}
{
name: 'redisconnectionstring'
keyVaultUrl: '${keyVaultBaseUrl}/dialogportenRedisConnectionString'
identity: 'System'
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Infrastructure": {
"Redis": {
"Enabled": false
"ConnectionString": "localhost:6379"
},
"DialogDbConnectionString": "TODO: Add to local secrets",
"Maskinporten": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Infrastructure": {
"Redis": {
"Enabled": false
"ConnectionString": "TODO: Add to local secrets"
},
"DialogDbConnectionString": "TODO: Add to local secrets",
"Maskinporten": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Infrastructure": {
"Redis": {
"Enabled": false
"ConnectionString": "TODO: Add to local secrets"
},
"DialogDbConnectionString": "TODO: Add to local secrets",
"Maskinporten": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Infrastructure": {
"Redis": {
"Enabled": false
"ConnectionString": "TODO: Add to local secrets"
},
"DialogDbConnectionString": "TODO: Add to local secrets",
"Maskinporten": {
Expand Down

0 comments on commit 37fe982

Please sign in to comment.