17
steps:

- script: |
    echo "good"
    echo "nice"

This doesn't work. It prints 'good' successfully, but doesn't print nice and shows echo "nice" so the final output is

good echo 'nice'

I tried to remove | after the script: but still no luck. Any idea? I am running this on ubuntu machine.

Nika Kurashvili
  • 6,006
  • 8
  • 57
  • 123
  • This issue can not be reproduced. You can provide the complete YAML code see if we can help solve the issue if it is possible. Or, please try to add a Bash or Command line task and add inline script. Also, make sure the `|` is there since the script can not be recognized as two lines without it. – Yang Shen - MSFT Feb 26 '20 at 05:24
  • 1
    This problem has been resolved? since we didn't get more information. You can share the solution if it is possible. Thanks! – Yang Shen - MSFT Mar 05 '20 at 07:25

1 Answers1

22

I get the desired output. This is how my pipeline looks like:

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: |
    echo "good"
    echo "nice"

Output:

enter image description here


Answer to the question in the comments:

This is how I pass multiple parameters to the ARM deployment task:

steps:
  - task: AzureResourceManagerTemplateDeployment@3
    displayName: "MyDeployment"
    inputs:
      deploymentScope: "Resource Group"
      ConnectedServiceName: ${{ parameters.serviceConnection }}
      action: "Create Or Update Resource Group"
      resourceGroupName: "$(resourceGroupName)"
      location: "$(location)"
      templateLocation: "Linked artifact"
      csmFile: "$(Pipeline.Workspace)/drop/azuredeploy.json"
      overrideParameters: "
        -eventGridTopicName myEventGridName
        -appServicePlanName myAppServicePlan"
      deploymentMode: "Incremental"
Martin Brandl
  • 56,134
  • 13
  • 133
  • 172
  • How do you use mulitline when fx. providing override parameters in an ARM deployment task? overrideParameters: >- '-environment_name ${{ parameters.environmentName }} -vnetAddressPrefix ${{ parameters.vnetAddressPrefix }} -subnet1Prefix ${{ parameters.subnet1Prefix }} This doesn't seem to work I also tried with overrideParameters: | – Oliver Nilsen Aug 03 '20 at 10:59
  • @OliverNilsen I edited my answer and included a sample how I pass multiple parameters (not with mulitline) – Martin Brandl Aug 04 '20 at 08:53
  • 1
    I have figured it out. Posted an answer to my own question here: https://stackoverflow.com/questions/63228354/azure-pipelines-arm-deployment-task-yaml-multiline – Oliver Nilsen Aug 07 '20 at 14:25
  • 1
    @MartinBrandl It seems to me that the answer to the comment is not directly related to the original question. – José Andias Oct 13 '22 at 12:23