From 79309c2d6e0a42cd2456a8f119fe257cd760e81d Mon Sep 17 00:00:00 2001 From: Lars Fagerbakke <162430411+larfeq@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:40:19 +0200 Subject: [PATCH] Fix: Changed pipeline variable name (#681) - [ ] New feature - [x] Bug fix - [ ] High impact **Work description**: The template used the wrong variable name. **Expected result**: Pipeline runs again Link to workitem: [AB#55752](https://statoil-proview.visualstudio.com/Fusion%20Resource%20Allocation/_workitems/edit/55752) **Test description**: - [ ] Can be tested - [ ] Automatic tests created / updated - [x] Local tests are passing CI pipeline runs after update **Checklist**: - [x] Considered automated tests - [ ] Considered updating specification / documentation - [ ] Considered work items - [ ] Considered security - [ ] Performed developer testing - [x] Checklist finalized / ready for review --- pipelines/secret-rotation-pipeline.yml | 12 ++++++------ .../templates/secret-rotation/ensure-secret.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pipelines/secret-rotation-pipeline.yml b/pipelines/secret-rotation-pipeline.yml index 92654f590..f402a00c0 100644 --- a/pipelines/secret-rotation-pipeline.yml +++ b/pipelines/secret-rotation-pipeline.yml @@ -46,7 +46,7 @@ stages: - template: templates/secret-rotation/ensure-secret.yml parameters: azureSubscription: $(subscriptionServiceNonProd) - azureSubscriptionCore: $(azureSubscriptionCore) + azureSubscriptionCore: $(subscriptionServiceCore) name: 'resourceApi' secretName: 'AzureAd--ClientSecret' vaultName: $(vaultName) @@ -64,7 +64,7 @@ stages: - template: templates/secret-rotation/ensure-secret.yml parameters: azureSubscription: $(subscriptionServiceNonProd) - azureSubscriptionCore: $(azureSubscriptionCore) + azureSubscriptionCore: $(subscriptionServiceCore) name: 'resourceApi' secretName: 'AzureAd--ClientSecret' vaultName: $(vaultName) @@ -83,7 +83,7 @@ stages: - template: templates/secret-rotation/ensure-secret.yml parameters: azureSubscription: $(subscriptionServiceNonProd) - azureSubscriptionCore: $(azureSubscriptionCore) + azureSubscriptionCore: $(subscriptionServiceCore) name: 'resourceApi' secretName: 'AzureAd--ClientSecret' vaultName: $(vaultName) @@ -102,7 +102,7 @@ stages: - template: templates/secret-rotation/ensure-secret.yml parameters: azureSubscription: $(subscriptionServiceNonProd) - azureSubscriptionCore: $(azureSubscriptionCore) + azureSubscriptionCore: $(subscriptionServiceCore) name: 'resourceApi' secretName: 'AzureAd--ClientSecret' vaultName: $(vaultName) @@ -121,8 +121,8 @@ stages: steps: - template: templates/secret-rotation/ensure-secret.yml parameters: - azureSubscription: $(subscriptionServiceNonProd) - azureSubscriptionCore: $(azureSubscriptionCore) + azureSubscription: $(subscriptionServiceProd) + azureSubscriptionCore: $(subscriptionServiceCore) name: 'resourceApi' secretName: 'AzureAd--ClientSecret' vaultName: $(vaultName) diff --git a/pipelines/templates/secret-rotation/ensure-secret.yml b/pipelines/templates/secret-rotation/ensure-secret.yml index bf5cf2878..8945f880d 100644 --- a/pipelines/templates/secret-rotation/ensure-secret.yml +++ b/pipelines/templates/secret-rotation/ensure-secret.yml @@ -1,6 +1,6 @@ parameters: - name: azureSubscription - - name: subscriptionServiceCore + - name: azureSubscriptionCore ## The name is used to scope variables if multiple secrets are rotated within the pipeline. - name: name displayName: Secret id, to scope variables @@ -24,7 +24,7 @@ steps: - template: generate-secret.yml parameters: condition: eq(variables['${{ parameters.name }}_Check.generateNew'], 'true') - azureSubscription: ${{ parameters.subscriptionServiceCore }} + azureSubscription: ${{ parameters.azureSubscriptionCore }} name: ${{ parameters.name }}_SecretGen clientId: ${{ parameters.aadApplicationId }} secretDescription: 'FRA - $(vaultName) - ${{ parameters.secretName }}' @@ -40,6 +40,6 @@ steps: - template: cleanup-expired-secrets.yml parameters: - azureSubscription: ${{ parameters.subscriptionServiceCore }} + azureSubscription: ${{ parameters.azureSubscriptionCore }} clientId: ${{ parameters.aadApplicationId }} keyIds: $(${{ parameters.name }}_Check.keysToDelete) \ No newline at end of file