I have a release pipeline in Azure DevOps, one of the steps is running test designed using Nunit.
YAML of task:
steps:
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: custom
projects: '**/a/Tests.dll'
custom: vstest
arguments: '--logger:"trx;LogFileName=test.trx" '
In my tests Setup I am retrieving few settings from Environment variables using:
private static IConfiguration InitConfiguration()
{
var config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables()
.Build();
return config;
}
I am also storing the values of my environment variables in Azure DevOps variable groups.
Everything works fine when my variables are not locked, they are retrieved successfully and tests run fine.
However when I lock the secret ones their value comes empty hence my tests fail to run.
What should I change in order for locked variables to be correctly read from my application.

