Skip to content

Commit

Permalink
Fix/correct maskinporten env (#561)
Browse files Browse the repository at this point in the history
* fix maskinporten env values

* fix param

* fix null value for in app container values

---------

Co-authored-by: Hammerbeck <andreas.hammerbeck@digdir.no>
  • Loading branch information
Andreass2 and Hammerbeck authored Dec 19, 2024
1 parent 6b103fd commit da7d40c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .azure/modules/containerApp/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var probes = [
}
]

var containerAppEnvVars = [
var containerAppEnvVarsdefault = [
{ name: 'ASPNETCORE_ENVIRONMENT', value: environment }
{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', secretRef: 'application-insights-connection-string' }
{ name: 'DatabaseOptions__ConnectionString', secretRef: 'correspondence-ado-connection-string' }
Expand All @@ -71,7 +71,7 @@ var containerAppEnvVars = [
name: 'MaskinportenSettings__ExhangeToAltinnToken'
value: 'true'
}
{ name: 'MaskinportenSettings__TokenExchangeEnvironment', value: maskinporten_token_exchange_environment }

{ name: 'MaskinportenSettings__EncodedJwk', secretRef: 'maskinporten-jwk' }
{ name: 'GeneralSettings__CorrespondenceBaseUrl', value: correspondenceBaseUrl }
{ name: 'GeneralSettings__SlackUrl', secretRef: 'slack-url' }
Expand All @@ -80,6 +80,16 @@ var containerAppEnvVars = [
{ name: 'IdportenSettings__ClientId', secretRef: 'idporten-client-id' }
{ name: 'IdportenSettings__ClientSecret', secretRef: 'idporten-client-secret' }
]

var containerAppEnvVars = concat(
containerAppEnvVarsdefault,
maskinporten_token_exchange_environment != '' && maskinporten_token_exchange_environment != null
? [
{ name: 'MaskinportenSettings__TokenExchangeEnvironment', value: maskinporten_token_exchange_environment }
]
: []
)

resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
name: '${namePrefix}-app'
location: location
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ jobs:
PLATFORM_BASE_URL: ${{ secrets.PLATFORM_BASE_URL }}
PLATFORM_SUBSCRIPTION_KEY: ${{ secrets.PLATFORM_SUBSCRIPTION_KEY }}
SLACK_URL: ${{ secrets.SLACK_URL }}
MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT: ${{ secrets.MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT }}
MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT: ${{ secrets.MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT }}

0 comments on commit da7d40c

Please sign in to comment.