How to lowercase Azure DevOps pipeline variables names

Viewed 7749

May you please suggest how to lowercase the environment name in Azure DevOps pipelines.

enter image description here

When environment name is "Test" I want account name to be myprefixtest.

2 Answers

I don't think there is an option to do to lower when you use the task (like in your Azure CLI task), but you can add a small PowerShell script that does it before the Azure CLI task:

$envName = "$(Release.EnvironmentName)"
$lower = $envName.ToLower()
Write-Host "##vso[task.setvariable variable=Release.EnvironmentName;]$lower"

enter image description here

Have you seen lower? This might help with what you are trying to do.

Related