IConfiguration provider for Azure pipeline variables

285 views Asked by At

Is there an IConfiguration provider for Azure Devops pipeline variables?

I googled this for about 15 minutes but could not find anything.

We have a series of net5.0 projects with corresponding unit and integrations tests that rely in pipeline variables as follows:

  • Tests use an IConfigurationBuilder, including environment variables
  • Variables are added to an Azure Devops Pipeline
  • Modify the pipeline yaml to map the pipeline variables to environment variables

This is fairly straight forward. For each configuration setting that needs to be driven by a pipeline variable, we:

I'd prefer to do something like:

var config = new ConfigurationBuilder()
  .AddEnvironmentVariables(...)
  .AddPipelineVariables(...)  // considering writing this; don't what to reinvent the wheel

and skip the modifications to the pipeline yaml.

0

There are 0 answers