How to use the octopus to deploy SSRS reports

I want to use the step Deploy SSRS Reports from a package which Uploads SSRS reports to an SSRS server from a NuGet package.

I create this step and filled in all the fields but don’t know how to use the fields like report service url and report folder to deploy the package.

also, should I extract the package before I deploy it?

Hi,

Thanks for reaching out. I’ve added Shawn to the conversation. He’s the creator of the step template, and i’m sure he’ll be able to give you an answer better than anyone else :slight_smile:

Thanks!

Dalmiro

After checking, I found where is the step template is declared and the powershell script that will be execute with helpful commonet. Now it is cleear for me.

Thanks

Greetings! SSRS includes some Web Services (.asmx) when installed (https://msdn.microsoft.com/en-us/library/ms155398(v=sql.105).aspx). The PowerShell included in the Step Template makes use of these Web Services to automatically upload reports, attach datasources, and update report parameters.

The Report Folder is simply the relative url of where the report is to be uploaded. For example, off the root of the SSRS instance you have a folder called TestReports, the entry would be /TestReports.

Once you upload the NuGet package to the target tentacle, the PowerShell script uses the location of the uploaded package (SSRS Package Step) to gather all of the .rdl files and upload them to the SSRS instance. There is no need to extract the package manually.

Excellent! Feel free to reply to this post if you have further questions, I’d be happy to answer them :slight_smile:

Nice clean script, thumps up. Nice to have automatic rollback script in case of failure to restore the backed up report, Also set the parameter value something you don’t need to do every time after you set the default values for each customer (I will add extra parameter to make it optional).

Mohammad

Thanks! That was originally a C# application that I ported over to PowerShell. Learned somet interesting things about PowerShell in the development process :slight_smile:

I notice the we always override the report default values, also when we back up the report the script does not backup the latest version of parameters default values. Do you have any Idea how to not override the parameters default value?

Mohammad Tamim │ Senior Software Application Developer, CMS

Phone: +31 20 655 9016 │ Mobile: +31 (0) 611046763
Email: Mohammad.Tamim@aerdata.commailto:Mohammad.Tamim@aerdata.com │ Web: www.aerdata.comhttp://www.aerdata.com/

I apologize Mohammad, I don’t fully understand what you are referring to. There is (or at least was) a known bug in SSRS where if you upload a report with default parameters and then later change the default values and upload the report again, the default parameters on the SSRS server would not change. The Update-ReportParamters method was written to force the SSRS server to update the default parameter values to what is in the report definition. If you’d like the SSRS server not to be updated, simply comment out the Update-ReportParameters method call in the PowerShell to bypass.

The Backup-ExistingItem method simply downloads the report definition from the report server, it should have the default values that are contained in the report definition. If you upload a backup to the report server manually, you face the bug I previously mentioned and the report parameters will not get set back to what they were in the backup. You would need to call the Update-ReportParamters method to set them back to what they used to be.

Does that make sense?

Hi Shawn,
Could you please elaborate the step to packaging the SSRS project to Octopus Deploy.

Thanks,
Asan

@Asan, certainly!

In my organization, we use Team Foundation Server as our source control solution. To create the SSRS NuGet package, I created a Build Step using PowerShell to invoke devenv.exe to perform the build. After the build is complete, I invoke Octo.exe to package up the bin<build configuration> into NuGet package and upload that to the internal NuGet server within Octopus.

Were you looking for specific code to do this?

Hi Shawn,
Thanks for your reply.

My situation is, I have .NET solution with WEB, WCF and SSRS projects.

I am using TFS build as CI and used below MS build argument to push.

/p:RunOctoPack=true /p:OctoPackPublishPackageToHttp=https://abc.xyz/nuget/packages /p:OctoPackPublishApiKey=API-123456

however, for SSRS project I am stuck.

Will you be able to provide the step for SSRS to use octopus deploy.

Thanks,
Asan

@Asan You’re running into the same issue I did, MS Build does not know how to build SSRS, SSIS, or SSAS project types. Which version of TFS are you using?

Hi Shawn,

I am using TFS 2013 on premise.

Thanks,
Asan

@Asan, Gotcha. For that version, we switched referencing the .sln file in the build definition to a .proj file with syntax like:

EDIT: correction, we add on the .proj file to the build process. For TFS 2015, I’ve created my own Build Tasks to perform the same operation.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <OutDir Condition=" '$(OutDir)'=='' ">$(MSBuildThisFileDirectory)bin\</OutDir>
        <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>
        <SourceHome Condition=" '$(SourceHome)'=='' ">$(MSBuildThisFileDirectory)</SourceHome>
        <ToolsHome Condition=" '$(ToolsHome)'=='' ">$(MSBuildThisFileDirectory)Tools\</ToolsHome>
    </PropertyGroup>

  <!--
  <ItemGroup>
    <Solution Include="$(SourceHome)\**\*.*proj">
      <AdditionalProperties>OutDir=$(OutDir);Configuration=$(Configuration)</AdditionalProperties>
    </Solution>
  </ItemGroup>
-->

  <Target Name="Compile">
    <Exec Command="Powershell &quot;e:\powershellscripts\PackageAndDeployProject.ps1&quot; -x86DevEnvExePath '$(MSBuildProgramFiles32)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe' -ProjectFilePath '$(MSBuildStartupDirectory)\ELMS_REPORTS\ELMS_REPORTS\ELMS_REPORTS.rptproj' -NugetExePath 'e:\nuget\NuGet.exe' -APIKey ****-NugetServerURL http://<Octo server>/nuget/packages -ExternalPackageId '<name of project for version synchronization>' -OctoExePath 'e:\nuget\octo.exe' -PackageId '<project name>.Reports'"/>
  </Target>
</Project>

If you send me an email to shawn dot sesna at Hotmail dot com, I can send you the PowerShell