I'm trying to setup a 'Replace Tokens Task' for my build pipeline from a JSON file that will hold environmental variables as follow:
And then my JSON environment file:
The JavaScript target file to replace the tokens in:
Unfortunately, I'm getting the following error:
What am I missing here?
What am I missing here?
I can reproduce same issue on my side, and I think it only indicates there's something wrong with your Variable files(JSON)
input:
Please make sure the variables are successfully loaded from the variable json file.
1.Make sure your env-config.json
file has content below:
{
"alambda.endpoint":"ForTest"
}
2.Check carefully about the path of your env-config.json
file! (In my opinion, your issue is more like a path issue~) If the task can't find and load the file, it also throws variable not found
. For this:
**/env-config.json
instead of the very long path.env-config.json
file to root folder $(System.DefaultWorkingDirectory)
with Copy Task or what. (About System.DefaultWorkingDirectory
see here). Then try it again with **/env-config.json
.