To build a Report Server Project (.rptproj) with your VSVS build agent, you first have to install the required services like the following error message during a build describes
##[error]MyReport.rptproj(60,3): Error MSB4019: The imported project “C:\Program Files (x86)\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets” was not found. Confirm that the path in the
declaration is correct, and that the file exists on disk.
So we are missing Microsoft.ReportingServices.MSBuilder.targets on the machine of our build agent. We use a self hosted vsts build agent running on a virtual machine with Windows 10 and Visual Studio 2019 Community installed.
To let Visual Studio 2019 (on the machine of our build agent) install all requirements you have to add one workload and install one extension.
Workload Data storage and processing
You have to add the workload Data storage and processing to Visual Studio 2019.
Extension Microsoft Reporting Services Project
And install the extension Microsoft Reporting Services Project from the Visual Studio Marketplace.
For a solution with other versions of Visual Studio check out the Microsoft documentation about SSDT.