Closed fbuser1 closed 5 months ago
Hi @fbuser1,
The issue you are facing is because the systems variables real names don't have _
but .
. It's the internal mechanism of Azure Pipelines which replaces dots by underscores so that it can set them as environment variables.
In the previous versions of the task as the code was only meant for Azure Pipelines using the modified name with underscore was not an issue because when getting a variable value i was using the MS library which was doing the name conversion internally.
With version 6 I've moved the logic of the task in a reusable library so in the this version I'm using another MS function to first get all defines variables with their values and this function returns the real variable names with dots.
In your case I see 2 options:
app: __BUILD.REPOSITORY.NAME__
svc: __BUILD.DEFINITIONNAME__
tier: api
Hi @qetza, thank you so much for your assistance! Your suggestion to replace underscores with dots in the variable names worked perfectly and resolved my issue. I really appreciate your prompt and clear explanation!
Hi @fbuser1,
I've release a new patch on v6 (6.0.5) with a reworked core lib which now allows to used normalized names in your token as in the previous versions.
So using __BUILD_REPOSITORY_NAME__
and __BUILD_DEFINITIONNAME__
in your files will now be replaced correctly.
values.yaml
replacetokens@4 task configuration
I can't solve the problem of replacing default (system) Azure DevOps variables after migrating tasks to version 6
replacetokens@6 task configuration
Also, I have the same issue with the BUILD_DEFINITIONNAME variable. After rolling back task to version 4, everything works again as expected.