Hi Gaurav Kumar,
Thank you for posting your question in the Microsoft Q&A forum
This pipeline will output each echo statement with the substituted number during the job run. No syntax errors or duplicate blocks are present in this cleaned-up version. This YAML pipeline is valid for printing a phone number variable multiple times in Azure DevOps. For best results, use this properly formatted version
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
variables:
PHONE_NUMBER: "18663477488"
steps:
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
- script: |
echo "Testing raw number: $(PHONE_NUMBER)"
echo "With + prefix: +$(PHONE_NUMBER)"
echo "Repeated check: $(PHONE_NUMBER)"
echo "Validation again for number: $(PHONE_NUMBER)"
echo "Final confirmation: +$(PHONE_NUMBER) is valid"
displayName: 'Print phone number 18663477488 multiple times'
I hope the provided answer is helpful,
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.
Thanks