Specifying Credentials when publishing/deploying SSRS project using MSBuild on a non-domain PC

Tim A 0 Reputation points

We currently have multiple SSRS report projects that are able to deploy to our SSRS server using MSBuild. The command we use is:

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe" myproj.rptproj /t:Deploy /p:configuration=Release /p:OverwriteDatasets=False /p:OverwriteDataSources=False /p:TargetDataSourceFolder="Data Sources" /p:TargetReportFolder="Reports" /p:TargetServerURL="http://xxxx.xxxx.com/reportserver"

We are working on building a new CI/CD system and this new environment is not on our domain. When attempting to call the previous command from this environment, we are getting the error "Could not connect to the report server http://xxxx.xxxx.com/reportserver. Verify that the TargetServerURL is valid and that you have the correct permissions to connect to the report server.". Based on previous research, we attempted to provide credentials using the following command:

cmdkey /add:xxxx.xxxx.com /user:domain\user /pass:password

After providing a valid user in this command, we are still receiving the same error. We checked the SSRS server event viewer, and MSBuild is sending the computer username/password, not the credentials we provided in the cmdkey command.

We also tried providing credentials directly in the msbuild command: /p:username=domain\user /p:password=password

We are able to access the http://xxxx.xxxx.com/reportserver endpoint via a browser from the CI/CD environment VM.

How do we provide domain\user and password to MSBuild to allow us to deploy from this non-domain environment?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,818 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AniyaTang-MSFT 12,326 Reputation points Microsoft Vendor

    Hi @Tim A

    I'm sorry I don't know MSBuild very well.

    I found this link for you:


    If you want to know more information, I suggest you go to MSBuild related platforms for help.

    Hope this can help you.

    Best regards,