diff --git a/.azure/modules/containerApp/main.bicep b/.azure/modules/containerApp/main.bicep index 65492387..5ed8ce04 100644 --- a/.azure/modules/containerApp/main.bicep +++ b/.azure/modules/containerApp/main.bicep @@ -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' } @@ -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' } @@ -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 diff --git a/.github/workflows/deploy-to-environment.yml b/.github/workflows/deploy-to-environment.yml index 5af60722..25425592 100644 --- a/.github/workflows/deploy-to-environment.yml +++ b/.github/workflows/deploy-to-environment.yml @@ -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 }} \ No newline at end of file + MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT: ${{ secrets.MASKINPORTEN_TOKEN_EXCHANGE_ENVIRONMENT }} \ No newline at end of file