Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to lowercase Azure DevOps pipeline variables names

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.

like image 655
Dovlet Mamenov Avatar asked Dec 13 '22 10:12

Dovlet Mamenov


1 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

like image 189
Shayki Abramczyk Avatar answered Feb 01 '23 06:02

Shayki Abramczyk