<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Thanos Draganidis on Medium]]></title>
        <description><![CDATA[Stories by Thanos Draganidis on Medium]]></description>
        <link>https://medium.com/@thanosd?source=rss-d1a109c09221------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nGq6BLnjMlVm-mcqTzTMUQ.jpeg</url>
            <title>Stories by Thanos Draganidis on Medium</title>
            <link>https://medium.com/@thanosd?source=rss-d1a109c09221------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:21:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thanosd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploy Power BI template reports in a multitenant environment]]></title>
            <link>https://medium.com/@thanosd/deploy-power-bi-template-reports-in-a-multitenant-environment-26a9cb84079?source=rss-d1a109c09221------2</link>
            <guid isPermaLink="false">https://medium.com/p/26a9cb84079</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Thanos Draganidis]]></dc:creator>
            <pubDate>Mon, 30 Apr 2018 09:24:32 GMT</pubDate>
            <atom:updated>2018-04-30T09:35:15.557Z</atom:updated>
            <content:encoded><![CDATA[<p>Streamline the process of deploying a report to your customers</p><blockquote>Have you ever thought of sharing the amazing pbix that your teams have produced to all your clients with one click? And every client could only play with his data? This is what this story is all about.</blockquote><p>Here, in <a href="https://www.nipo.com/">Nipo</a>, we decided to go ahead and implement a solution that would allow us to provide predefined reports to our clients. To make them happy and their lives easier.</p><p>For simplicity, let’s assume the following:</p><ul><li>There’s already an AppWorkspace (ex. OrganizationTemplates), where the template reports (pbix) will reside.</li><li>For security, maintenance and performance reasons, we decided every tenant to have its own AppWorkspace.</li><li>We have already created a pbix report in PowerBi Desktop and upload it to the OrganizationTemplates AppWorkspace (either using the PowerBI Service or a custom application).</li><li>We make sure that the report has a parameter that uniquely identifies the tenant, which will be used to filter the data for each tenant.</li><li>Take notice that you can’t upload a pbit file in the PowerBi service. Only pbix and excel files are allowed.</li></ul><p>To make a long story short, for every tenant we send a message (ex. ActivateTemplate) which contains all the required information. A custom background job will receive the message and copy the template report to the tenant’s app workspace with the appropriate credentials and parameters.</p><p>Let’s get our hands dirty with some more technical stuff and follow a step-by-step approach in order to see how we could copy the template report to a tenant’s app workspace.</p><p>View the complete code <a href="https://gist.github.com/tdraganidis/556e862e2d73792b4cfa7e3477d45b8e">here</a>.</p><p><strong>Step 1: Export-Import the template to the tenant’s app workspace</strong></p><p>Use the <em>Export-Import</em> method when you have one dataset for each report. If you have one dataset for many reports, then the <em>Clone-Rebind</em> method seems more appropriate.</p><p>The Power BI Embedded SDK for the import method internally uses the Length property of the stream in order to select a different method for files bigger than 1GB. This causes a “Seek operation is not supported” exception when you try to import the exported stream, which is read only. Preferably, you may use the REST API instead of the SDK to avoid the conversion of the read-only file stream to a regular stream (if you know that you won’t have so big files).</p><p><strong>Step 2: Set Report Parameters</strong></p><p>One of the prerequisites is that the pbix report, that will be used as template, should have at least one parameter in order to uniquely identify each tenant, for example <em>TenantId </em>(could also add <em>ServerName</em>, <em>DatabaseName</em>).</p><p>At this step, we will set the report dataset’s TenantId parameter with the actual value. This will allow us to filter the report data before the report is available for use.</p><p><strong>Step 3: Patch the credentials for reports using Azure SQL data sources</strong></p><p>In order to be sure that each tenant access its own database, we update the data source connection details: the Server and the Database.</p><p><strong>Step 4: Update the credentials for the connection</strong></p><p>Having specified the server and the database was the first step in order to allow access to the report’s data. There’s one more step that we should take care of: updating the credentials for the connection. That means which user will be used to connect to the already defined server and database.</p><p>Before trying to update the credentials, we <strong>must</strong> reload the Gateway data sources in order to take the connection details applied in the previous step. After the reload the Gateway data sources will point to the correct server and database. Otherwise, they would point to the report’s initial server and database.</p><p><strong>Step 5: Refresh the dataset</strong></p><p>In order for the data to be visible to the user, the dataset refresh should be finished. Take notice that the refresh operation also uses capacity and it may take more time than expected even for a small dataset if there’s already something else consuming the available capacity.</p><p>Resources:</p><ul><li><a href="https://powerbi.microsoft.com/en-us/blog/duplicate-workspaces-using-the-power-bi-rest-apis-a-step-by-step-tutorial/">Duplicate Workspaces using REST API</a></li><li><a href="https://msdn.microsoft.com/en-us/library/mt147898.aspx">Power BI REST API</a></li><li><a href="https://github.com/Microsoft/PowerBI-CSharp">Power BI Embedded SDK</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26a9cb84079" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>