DEV Community

Sanjeevi Subramani
Sanjeevi Subramani

Posted on • Originally published at lkgforit.com on

Azure File Transformation Task doesn't work for variable name with hyphen

Read this article on how to implement File Transformation Task implementation:

https://lkgforit.com/azure-devops-yaml-file-transformation-task-for-json-file-end-to-end

In some scenarios YAML File transformation task fail to update the variable values inside the json/xml file even though we have variables with same name matches.

One of those scenarios is that when we have hyphen in the variable name matching text then it doesn't work.

This doesn't work.

{
"element-ToBe-Replaced":""
}

Enter fullscreen mode Exit fullscreen mode

Try to change those variables without any special characters then it will work fine.

This will work if you have

elementToBeReplaced

variable in pipeline variables and have following sample json in configuration json.

{
"elementToBeReplaced":""
}

Enter fullscreen mode Exit fullscreen mode

Discussion (0)