diff --git a/.azure/applications/web-api-eu/staging.bicepparam b/.azure/applications/web-api-eu/staging.bicepparam new file mode 100644 index 000000000..d9a7c977c --- /dev/null +++ b/.azure/applications/web-api-eu/staging.bicepparam @@ -0,0 +1,12 @@ +using './main.bicep' + +param environment = 'staging' +param location = 'norwayeast' +param gitSha = readEnvironmentVariable('GIT_SHA', '') +param imageTag = readEnvironmentVariable('IMAGE_TAG', '') + +// secrets +param environmentKeyVaultName = readEnvironmentVariable('ENVIRONMENT_KEY_VAULT_NAME', '') +param containerAppEnvironmentId = readEnvironmentVariable('CONTAINTER_APP_ENVIRONMENT_ID', '') +param appInsightConnectionString = readEnvironmentVariable('APP_INSIGHTS_CONNECTION_STRING', '') +param appConfigurationName = readEnvironmentVariable('APP_CONFIGURATION_NAME', '') diff --git a/.azure/applications/web-api-migration-job/staging.bicepparam b/.azure/applications/web-api-migration-job/staging.bicepparam new file mode 100644 index 000000000..dd25e8e08 --- /dev/null +++ b/.azure/applications/web-api-migration-job/staging.bicepparam @@ -0,0 +1,9 @@ +using './main.bicep' + +param environment = 'staging' +param location = 'norwayeast' +param imageTag = readEnvironmentVariable('IMAGE_TAG', '') +param containerAppEnvironmentId = readEnvironmentVariable('CONTAINTER_APP_ENVIRONMENT_ID', '') + +//secrets +param adoConnectionStringSecretUri = readEnvironmentVariable('ADO_CONNECTION_STRING_SECRET_URI', '') diff --git a/.azure/applications/web-api-so/staging.bicepparam b/.azure/applications/web-api-so/staging.bicepparam new file mode 100644 index 000000000..d9a7c977c --- /dev/null +++ b/.azure/applications/web-api-so/staging.bicepparam @@ -0,0 +1,12 @@ +using './main.bicep' + +param environment = 'staging' +param location = 'norwayeast' +param gitSha = readEnvironmentVariable('GIT_SHA', '') +param imageTag = readEnvironmentVariable('IMAGE_TAG', '') + +// secrets +param environmentKeyVaultName = readEnvironmentVariable('ENVIRONMENT_KEY_VAULT_NAME', '') +param containerAppEnvironmentId = readEnvironmentVariable('CONTAINTER_APP_ENVIRONMENT_ID', '') +param appInsightConnectionString = readEnvironmentVariable('APP_INSIGHTS_CONNECTION_STRING', '') +param appConfigurationName = readEnvironmentVariable('APP_CONFIGURATION_NAME', '') diff --git a/.azure/infrastructure/infrastructure.bicep b/.azure/infrastructure/main.bicep similarity index 100% rename from .azure/infrastructure/infrastructure.bicep rename to .azure/infrastructure/main.bicep diff --git a/.azure/infrastructure/environments/production.bicepparam b/.azure/infrastructure/production.bicepparam similarity index 91% rename from .azure/infrastructure/environments/production.bicepparam rename to .azure/infrastructure/production.bicepparam index e2ab28fe5..7a915942c 100644 --- a/.azure/infrastructure/environments/production.bicepparam +++ b/.azure/infrastructure/production.bicepparam @@ -1,9 +1,8 @@ -using '../infrastructure.bicep' +using './main.bicep' param environment = 'production' param location = 'norwayeast' param keyVaultSourceKeys = json(readEnvironmentVariable('KEY_VAULT_SOURCE_KEYS', '[]')) -param gitSha = readEnvironmentVariable('GIT_SHA', '') // secrets param dialogportenPgAdminPassword = readEnvironmentVariable('PG_ADMIN_PASSWORD', '') diff --git a/.azure/infrastructure/environments/soak.bicepparam b/.azure/infrastructure/soak.bicepparam similarity index 96% rename from .azure/infrastructure/environments/soak.bicepparam rename to .azure/infrastructure/soak.bicepparam index a424f8ff3..00b5f04a1 100644 --- a/.azure/infrastructure/environments/soak.bicepparam +++ b/.azure/infrastructure/soak.bicepparam @@ -1,4 +1,4 @@ -using '../infrastructure.bicep' +using './main.bicep' param environment = 'soak' param location = 'norwayeast' diff --git a/.azure/infrastructure/environments/staging.bicepparam b/.azure/infrastructure/staging.bicepparam similarity index 96% rename from .azure/infrastructure/environments/staging.bicepparam rename to .azure/infrastructure/staging.bicepparam index deab50740..7fc58ba73 100644 --- a/.azure/infrastructure/environments/staging.bicepparam +++ b/.azure/infrastructure/staging.bicepparam @@ -1,4 +1,4 @@ -using '../infrastructure.bicep' +using './main.bicep' param environment = 'staging' param location = 'norwayeast' diff --git a/.azure/infrastructure/environments/test.bicepparam b/.azure/infrastructure/test.bicepparam similarity index 96% rename from .azure/infrastructure/environments/test.bicepparam rename to .azure/infrastructure/test.bicepparam index fef14e78f..0c8051eb9 100644 --- a/.azure/infrastructure/environments/test.bicepparam +++ b/.azure/infrastructure/test.bicepparam @@ -1,4 +1,4 @@ -using '../infrastructure.bicep' +using './main.bicep' param environment = 'test' param location = 'norwayeast' diff --git a/.github/workflows/action-build-infrastructure.yml b/.github/workflows/action-build-infrastructure.yml index 01bf5c8ed..33f29bbd2 100644 --- a/.github/workflows/action-build-infrastructure.yml +++ b/.github/workflows/action-build-infrastructure.yml @@ -37,7 +37,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Lint Bicep files - run: az bicep build --file .azure/infrastructure.bicep + run: az bicep build --file .azure/infrastructure/main.bicep # todo: run deployment with Validate deployment mode to send a preflight request to Azure Resource Manager diff --git a/.github/workflows/action-deploy-infra.yml b/.github/workflows/action-deploy-infra.yml index d94747e41..21576787e 100644 --- a/.github/workflows/action-deploy-infra.yml +++ b/.github/workflows/action-deploy-infra.yml @@ -97,14 +97,14 @@ jobs: SOURCE_KEY_VAULT_NAME: ${{ secrets.AZURE_SOURCE_KEY_VAULT_NAME }} with: scope: subscription - template: ./.azure/infrastructure.bicep + template: ./.azure/infrastructure/main.bicep subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} deploymentMode: Incremental deploymentName: dp-be-${{ inputs.environment }}-${{ github.sha }} region: ${{ inputs.region }} failOnStdErr: true additionalArguments: "${{inputs.dryRun && '--what-if'}}" - parameters: ./.azure/environments/${{ inputs.environment }}.bicepparam + parameters: ./.azure/infrastructure/${{ inputs.environment }}.bicepparam - name: Logout from azure if: ${{failure() || success()}}