Skip to content

[BUG]: wrong value used in script when overriden via env #21622

@amarkevich

Description

@amarkevich

New issue checklist

Task name

script

Task version

No response

Issue Description

There are 2 variable groups. If value from another variable passed via 'env' the old one used. Secrets are working as expected.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-latest

Relevant log output

step 1:

[ARM_CLIENT_ID]
[ARM_CLIENT_SECRET]

step 2:

[ARM_CLIENT_ID] <- expected [AZUREAD_CLIENT_ID]
[AZUREAD_CLIENT_SECRET]
[AZUREAD_CLIENT_ID]
[AZUREAD_CLIENT_SECRET]

Full task logs with system.debug enabled

No response

Repro steps

variables:
- group: STAGE_shared-dev # ARM_CLIENT_ID, ARM_CLIENT_SECRET
- group: AZUREAD # AZUREAD_CLIENT_ID, AZUREAD_CLIENT_SECRET

stages:
- stage: Terraform
  jobs:
  - deployment: Terraform
    pool:
      vmImage: 'ubuntu-latest'
    environment: 'keycloak-deploy-shared-dev'
    strategy:
      runOnce:
        deploy:
          steps:
          - script: |
              echo $ARM_CLIENT_ID
              echo $ARM_CLIENT_SECRET | base64
            env:
              ARM_CLIENT_SECRET: $(ARM_CLIENT_SECRET)

          - script: |
              echo $ARM_CLIENT_ID
              echo $ARM_CLIENT_SECRET | base64
              echo $(AZUREAD_CLIENT_ID)
              echo $(AZUREAD_CLIENT_SECRET) | base64
            env:
              ARM_CLIENT_ID: $(AZUREAD_CLIENT_ID)
              ARM_CLIENT_SECRET: $(AZUREAD_CLIENT_SECRET)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions