Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

To lower case during transformation #96

Closed
conrad-chan opened this issue Feb 2, 2019 · 6 comments
Closed

To lower case during transformation #96

conrad-chan opened this issue Feb 2, 2019 · 6 comments

Comments

@conrad-chan
Copy link

Is there a way to turn values to lower case (Or other basic transformation) while substituting?

@qetza
Copy link
Owner

qetza commented Feb 4, 2019

Hi,

Currently they are no transformation applied to values. Could you explain me your use case to see if this could be use more broadly and need to be added as a feature?

@jjburr
Copy link

jjburr commented Oct 1, 2019

+1
I replace tokens with build vars such as branch name in a yaml file, sometimes a branch name has an uppercase in it which causes the deployment to fail as the yaml as it expects values to be in lowercase.

@qetza
Copy link
Owner

qetza commented Oct 4, 2019

I'll see how i could had simple transformation (tolower, toupper) without breaking changes in a future version.

@unclev
Copy link

unclev commented Jan 25, 2021

With a variable that may be defined in mixed character case I would like it to be used in lower case for some substitutions.

In YAML pipeline as long as the mentioned variable is defined statically, or with the ##vso setVariable command, there can be another variable defined in lower case (with either AzDO pipeline lower() expression or in a PowerShell script).

The use case: defining the first variable in web UI (variable group or pipeline variable), and neither of them in the code, - for better maintainability.

replasetokens with transformations would do the work.

@stoopered
Copy link

This is not available in the UI step yet. When is that planned on being added?

@qetza
Copy link
Owner

qetza commented Feb 19, 2021

Hi @conrad-chan, @jjburr, @unclev, @stoopered,
Version 3.7.0 of the task is released and now supports the following transformations:

  • lower: make variable value lower case. Example: #{lower(MyVar)}#
  • upper: make variable value upper case. Example: #{upper(MyVar)}#
  • noescape: disable variable value escaping. (this can be used if you want to inject raw JSON or XML for example). Example: #{noescape(MyVar)}#

By default the separator after the transformation name are parenthesis (and ) but if needed those can be changed when the transformation feature is enabled.

@qetza qetza closed this as completed Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants