From dbe7d9a36bca4a3085c2637516c27bcb4a9b17c4 Mon Sep 17 00:00:00 2001 From: spellegrino021 Date: Fri, 22 Nov 2024 14:45:44 -0800 Subject: [PATCH] fix --- .../workflows/2022-10-01/WorkflowService.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/server/src/workflows/2022-10-01/WorkflowService.ts b/server/src/workflows/2022-10-01/WorkflowService.ts index c978cbd861..b7450f1ef8 100644 --- a/server/src/workflows/2022-10-01/WorkflowService.ts +++ b/server/src/workflows/2022-10-01/WorkflowService.ts @@ -34,19 +34,9 @@ export class WorkflowService20221001 { subscription-id: \${{ secrets.__subscriptionidsecretname__ }}\n`; const permssions = `permissions: id-token: write #This is required for requesting the JWT\n`; - const environment = `environment: - name: '__slotname__' - url: \${{ steps.deploy-to-webapp.outputs.webapp-url }}`; - workflowFile = workflowFile.replace(new RegExp(publishProfilePlaceholder, 'gi'), ''); workflowFile = workflowFile.replace(new RegExp(loginToAzureStepPlaceholder, 'gi'), loginToAzureStep); workflowFile = workflowFile.replace(new RegExp(permissionsPlaceholder, 'gi'), permssions); - - if (variables?.isRemoveEnvEnabled) { - workflowFile = workflowFile.replace(new RegExp(environmentPlaceholder, 'gi'), ''); - } else { - workflowFile = workflowFile.replace(new RegExp(environmentPlaceholder, 'gi'), environment); - } } else { if (variables?.isFlexConsumption) { const flexConsumptionPublishProfile = `publish-profile: \${{ secrets.__publishingprofilesecretname__ }} @@ -63,6 +53,15 @@ export class WorkflowService20221001 { workflowFile = workflowFile.replace(new RegExp(permissionsPlaceholder, 'gi'), ''); } + const environment = `environment: + name: '__slotname__' + url: \${{ steps.deploy-to-webapp.outputs.webapp-url }}`; + if (variables?.isRemoveEnvEnabled) { + workflowFile = workflowFile.replace(new RegExp(environmentPlaceholder, 'gi'), ''); + } else { + workflowFile = workflowFile.replace(new RegExp(environmentPlaceholder, 'gi'), environment); + } + Object.keys(variables).forEach(variableKey => { const replaceKey = `__${variableKey}__`; workflowFile = workflowFile.replace(new RegExp(replaceKey, 'gi'), variables[variableKey]);