79327784

Date: 2025-01-03 22:06:40
Score: 0.5
Natty:
Report link

I was here trying to reference an Azure DevOps parameter (as apposed to a variable) in a bash script step of my Pipeline. My script wasn't in a file; it was defined in the YML itself.

I eventually figured it out: instead of prefixing the reference in a dolor-sign and wrapping in parenthesis like $(), I needed to wrap my parameter reference in double brackets like ${{ }}.

Here is my YML:


parameters:
 - name: name
  displayName: Customer Name
  type: string
  default: ABC
  values:
  - ABC
  - DEF
  - GHI

# ...

    - bash: |
        my_cli --customer ${{ parameters.customer }}

Utilizing bash environment variables didn't seem to work for me, but maybe it could have. See Examples | Bash@3 - Bash v3 task for more on that.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Patrick Byers