0

I have an Azure DevOps pipeline which is failing to run because it seems to be using an old connection string.

  • The pipeline is for a C# project, where a FileTransform task updates an appsettings.json file with variables set on the pipeline.
  • The variables were recently updated to use a new connection string, however, when running a Console.PrintLn before using it and viewing it on the pipeline, it shows an outdated value.
  • Many updates similar to this have been run in the past without issue.
  • I've also recently added a Powershell task to echo what the value is in the variables loaded while the pipeline is running, which does display the new value.
  • I've checked the order of precedence of variables and there shouldn't be any other variables being used.
  • There is no CacheTask being used in this pipeline.

Does anyone have any advice to remedy this? It seems that the pipeline itself is just ignoring the variables set on the pipeline.

1 Answer 1

1

There is a problem with the recent File transform task version v1.208.0.

It will shows the warning message and not update the variable value correctly.

Warning example:

Resource file haven't been set, can't find loc string for key: JSONvariableSubstitution

Refer to this ticket: File transform task failing to transform files, emitting "Resource file haven't been set" warnings

The issue is from Task itself instead of the Pipeline configuration. Many users have the same issue.

Workaround:

You can change to use the File Transform task Version 2 to update the appsettings.json file.

Here is an example: Please remove the content in XML Transformation rules field and set the JSON file path

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I actually came across this on the Github issue. Posted a solution on the Dev Forum post you shared with some other findings too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question