Is there any way to display the code covrage report?
When you use VStest task to generate the Code Coverage report, the format is .coverage file. It doesn't support to show in the Code Coverage tab.
To display the code coverage report, you need to generate the cobertura format code coverage report.
For .netFramework project, you need to use Powershell to run the test the generate the cobertura report.
For example:
"install tools:"
&dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
&dotnet tool install coverlet.console --tool-path . --version 1.4.1
"`nmake reports dir:"
mkdir .\reports
"`nrun tests:"
Write-Host "`$unitTestFile value: $unitTestFile"
$coverlet = "$pwd\coverlet.exe"
"calling $coverlet for $($unitTestFile.FullName)"
&$coverlet "$(build.sourcesdirectory)/Bank1/Banktest/bin/release/xx.dll(DLL Path)" --target "dotnet" --targetargs "vstest $($unitTestFile.FullName) --logger:trx" --format "cobertura"
"`ngenerate report(s)"
gci -Recurse |
?{ $_.Name -eq "coverage.cobertura.xml" } |
%{ &"$pwd\reportgenerator.exe" "-reports:$($_.FullName)" "-targetdir:reports" "-reporttypes:HTMLInline;HTMLChart" }

Result:

For .Net Core project:
You can try the following sample:
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '$(Parameters.TestProjects)'
arguments: '--configuration $(BuildConfiguration) --collect:"XPlat Code Coverage" '
- script: 'dotnet tool install -g dotnet-reportgenerator-globaltool '
displayName: 'Command Line Script'
- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(build.sourcesdirectory) -reporttypes:"Cobertura"'
displayName: 'Command Line Script'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage from $(build.sourcesdirectory)/Cobertura.xml'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(build.sourcesdirectory)/Cobertura.xml'
For more detailed info, you can refer to these two tickets: Case1 and Case2