title: What is the correct way to access ADO yaml parameters in bash script?
body: <p>I have a template that is called and passed a set of parameters. I would like to use these in a bash script. When I define an inline bash script I can easily print the parameters out with ${{ parameter.foo }}. However if I define a bash script as a file and call it I'm unable to access the parameters.</p>
  <p>Here is a sample template, 'Inline Test' will spit out the parameters where as 'File Test' wont. So far two possible solutions I can see are, defining the parameter value as a 'task variable' and accessing it as $foo (example Inline Test), or potentially pass the parameter in as an argument to the 'File Test' task (example File Test 2). Is there an option to access yaml template parameters in an existing bash script from file and not one that is defined inline?</p>
  <pre><code>parameters:
  
    - name: webappName #webappName
      type: string
      default: webappName #set default for testing
  
    - name: resourceGroup #resourceGroup
      type: string
      default: resourceGroupName #set default for testing
  
    - name: subscription  #subscription 
      type: string
      default: s #set default for testing
  
    - name: preprod 
      type: boolean
      default: false  #default to false
  
    - name: env  
      type: string
      default: test
  
    - name: role  
      type: string
      default: s 
  
  steps:
  
    - checkout: 'x' #the repo that test.sh lives in
  
    - task: Bash@3
      inputs:
        displayName: 'Inline test'
        targetType: 'inline'
        script: |
          echo &quot;-----&quot;
          echo ${{ parameters.webappName }}
          echo &quot;-----&quot;
          echo ${{ parameters.resourceGroup }}
          echo &quot;-----&quot;
          echo ${{ parameters.subscription }}
          echo &quot;-----&quot;
          echo ${{ parameters.preprod }}
          echo &quot;-----&quot;
          echo ${{ parameters.env }}
          echo &quot;-----&quot;
          echo ${{ parameters.role }}
          echo &quot;-----&quot;
          echo &quot;##vso[task.setvariable variable=TESTROLE]${{ parameters.role }}&quot;
          echo &quot;-----&quot;
  
  
    - task: Bash@3
      displayName: 'File test'
      inputs:
        filePath: './test.sh'
  
    - task: Bash@3
      displayName: 'File test 2'
      inputs:
        arguments: ${{ parameters.role }}
        filePath: './test.sh'
  </code></pre>