Deploy SSRS Projects with Two New PowerShell Commands

I built two new PowerShell commands to deploy SSRS projects, and they have finally been merged into the ReportingServicesTools module. The commands are Get-RsDeploymentConfig & Publish-RsProject. While the Write-RsFolderContent command did already exist, and is very useful, it does not support deploying the objects in your SSRS Project to multiple different folders in your report server. These two new commands can handle deployment to multiple folders.

The concept is fairly simple, first you run the Get-RsDeploymentConfig
command to pull in all the deployment-target details from the SSRS project file. In SSRS projects you can have multiple deployment configurations, so you can specify which configuration you want to use by supplying the name of that configuration for the
-ConfigurationToUse parameter. This will give you back a PSObject with all the info it collected.


After that, you need to add the URL of the report portal manually (unfortunately, these are not included in the SSRS Project config files).

You can put all of that together and see the results like this:

$RSConfig = Get-RsDeploymentConfig RsProjectFile C:\source\repos\Financial Reports\SSRS_FR\SSRS_FR.rptproj ConfigurationToUse Dev01 $RSConfig | Add-Member PassThru MemberType NoteProperty Name ReportPortal Value http://localhost/PBIRSportal/

$RSConfig

Once that looks good to you, all you have to do is pipe that object to the Publish-RsProject command, and your deployment should start.

$RSConfig | Publish-RsProject

Some quick notes:

  • Obviously, the account running these commands will need a copy of the SSRS project it can point to, as well as the necessary credentials to deploy to the SSRS/PRIRS server you point it to.
  • For the Get-RsDeploymentConfig command, the SSRS project you are using must be in the VS 2019 project format. Otherwise, the command won’t know where to look for the correct info.
  • If you don’t know the name of the configuration you want to use, just point Get-RsDeploymentConfig to the project file, and it will give you back a list of configuration options to choose from.
  • Make sure you run Update-Module ReportingServicesTools
    to get these new commands.

FYI: I only had two SSRS projects available to test these commands with. They worked great for those two projects, but your SSRS project might include some complexities that I just didn’t have in either of the projects I tested with. If you have any trouble making this work, please give me a shout or file a bug on the GitHub project and I will try to help out.

Big thanks to Doug Finke ( t ) for his code contributions, and Mike Lawell ( t ) for his help testing, to make these two commands a reality.

Deploy SSRS Projects with these two new PowerShell commands in the ReportingServicesTools module!

Please Share This:

You may also like:

3 Responses

  1. Hi Aaron – this is exactly when I’ve been looking for to provide Ci/CD for SSRS report updates to a repo. I’m currently getting an error though which I cann’t work out.

    Publish-SSRSProject -path C:\SSRStoDeploy\Automated.rptproj -ServerUrl http://“servername”/Reports/ -Folder Automated -DataSourceFolder “Automated/Data Sources” -DataSetFolder “Automated/Datasets” -verbose

    It connects to the server and creates the folder but the fails:

    Publish-SSRSProject : Exception calling “GetItemType” with “1” argument(s): “The request failed with an empty response.”
    At C:\Powershell scripts\Deploy SSRS Project.ps1:16 char:1
    + Publish-SSRSProject -path C:\SSRStoDeploy\Automated.rptproj -ServerU …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Publish-SSRSProject], MethodInvocationException
    + FullyQualifiedErrorId : WebException,Publish-SSRSProject

  2. Hi Aaron, Thanks for this article. I am trying to use Get-RsDeploymentConfig, but when I am trying to run this command on my project file, its takes forever to get a response.

    1. Are you specifying a profile with the parameter? If not, it will pop-up for you to make a choice from the available profiles. Sometimes that pop-up is on a different screen, or behind something else.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow:

Subcribe to Blog Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

What I'm Saying on Twitter

Subscribe via feedburner

%d bloggers like this: