I am trying to execute terraform script to create ec2 and using output variables concept I want to get the ec2 public ip and assign it to a variable and pass that to another task. But I see that output variables using bash or script is not working in azure pipeline yml. I am using ubuntu agent.
- script: COMMAND=$(cat terraform.tfstate | grep 'public_ip"' | cut -d":" -f2 | cut -d'"' -f2) && echo "##vso[task.setvariable variable=ec2ip;]$COMMAND" && echo $ec2ip But I see no value is printing. Not sure whether the task.setvarible is working or not. Need some help to fix this.