-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AzureCLI does not preserve variable name case #9687
Comments
The task sets an environment variable using upper case. i.e. it will set |
Hi, I run Terraform in AzureCLI task, and I use env variables to pass some configuration to Terraform. Terraform attempts to fill unspecified configuration from the environment variables: https://www.terraform.io/docs/configuration/variables.html#environment-variables So I have to make sure that the case is correct. I can fix on my side fiddling with my scripts of course. In general, as I run in bash, it seems quite confusing that the case of the pipeline variable is not preserved. At least there should be a clear warning somewhere. |
@andreacassioli Would it help if you use command line variables to pass arguments to Terraform rather than depend on environment variables implicitly. |
@bishal-pdMSFT of course I could. But I use a Makefile and I do not want to change it every time I add or remove a variable! Moreover, there is a limit on the number of vars you can pass as argument. Anyway, my point is that a bash user would expect the case of a variable should to be preserved. The current behaviour is misleading. If you can not for whatever reason, please make it clear! |
This behavior is not defined by Azure CLI task. This is how the azure pipelines agent sets the environment variables and executes task. |
ping @bryanmacfarlane @chrisrpatterson |
@andreacassioli there is already a closed issue in pipelines agent repo which explains the behavior. If you do not agree with the explanation, you can re-open that issue. |
I am setting up a build pipeline in AzureDevOps. That pipeline has an AzureCLI task that uses a pipeline variable say
apiKey
. The variable name (the content of the variable is irrelevant here), is incamel style
.When the AzureCLI script runs as bash, it actually uses an upper case version of the variable name, i.e.
APIKEY
. This breaks some of my commands and scripts, as bash considers variable names to be case sensitive!The text was updated successfully, but these errors were encountered: