I added an integration test project in my Solution, using .NET Core 3.1 and xUnit. In this test project I also added an appsettings.json with a connectionstring that should be used locally.
"ConnectionStrings": {
"DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDb;Initial Catalog=MyApp_IntegrationTests;Integrated Security=True"
}
I also added the following in my build pipeline in Azure DevOps:
- task: DotNetCoreCLI@2
displayName: 'Run integration tests'
inputs:
command: test
projects: '**/*Tests.csproj'
arguments: '--configuration $(buildConfiguration)'
This fails because Azure does not support LocalDB. This makes sense, but i can't figure out how to transform the appsettings.json used by the test project in the pipeline. If I put in the Azure connectionstring in the appsettings.json and commit it, it works as expected.
Any suggestions on how I can fix this?