{"id":101669,"date":"2024-03-06T20:07:16","date_gmt":"2024-03-06T20:07:16","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=101669"},"modified":"2024-09-03T20:15:16","modified_gmt":"2024-09-03T20:15:16","slug":"reverse-creating-the-pbip-file-from-source-control","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/reverse-creating-the-pbip-file-from-source-control\/","title":{"rendered":"Reverse Creating the PBIP file from Source Control"},"content":{"rendered":"<p>On my article about <a href=\"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/bi-sql-server\/source-control-with-git-power-bi-and-microsoft-fabric\/\" target=\"_self\" rel=\"noopener\">Source Control with GIT, Power BI and Microsoft Fabric<\/a>, I illustrate how to use the <strong>PBIP file<\/strong>\u00a0format to include <strong>Power BI<\/strong> reports and semantic models in a source control process and stablish a <strong>SDLC<\/strong> (Software Development Lifecycle) for <strong>Power BI<\/strong>.<\/p>\n<p>However, the complete explanation is based on saving the development using PBIP format and inserting into source control.<\/p>\n<p><strong><em>What happens if we do the opposite?<\/em><\/strong><\/p>\n<h2>Linking a Workspace to the Repository<\/h2>\n<p>Let&#8217;s imagine we already have the report and semantic model published on the Power BI portal. Like on the image below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"358\" class=\"wp-image-101670\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/03\/a-screenshot-of-a-computer-description-automatica.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>We link the workspace to a repository, sending the content to the repository.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"672\" class=\"wp-image-101671\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/03\/a-screenshot-of-a-computer-description-automatica-1.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>Finally, we clone the repository to our local machine. Each object in the workspace will have its own folder.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"237\" height=\"169\" class=\"wp-image-101672\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/03\/a-screenshot-of-a-computer-description-automatica-2.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p><strong><em>How could we open the report and semantic model again in Power BI Desktop?<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2>Creating the PBIP File<\/h2>\n<p>When we start from Power BI and generate the repository, no PBIP file is generated. In this scenario, we need to generate the PBIP ourselves.<\/p>\n<p>The PBIP structure is very simple. It always points to a report and it&#8217;s the report which points to a dataset.<\/p>\n<p>On our example, a PBIP file for LakehouseLocalDS would be like this:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\" class=\"crayon:false\">{\r\n   <span style=\"color: #007700\">\"version\"<\/span>: <span style=\"background-color: #fff0f0\">\"1.0\"<\/span>,\r\n   <span style=\"color: #007700\">\"artifacts\"<\/span>: [\r\n      {\r\n         <span style=\"color: #007700\">\"report\"<\/span>: {\r\n            <span style=\"color: #007700\">\"path\"<\/span>: <span style=\"background-color: #fff0f0\">\"LakehouseLocalDS.Report\"<\/span>\r\n         }\r\n      }\r\n   ],\r\n   <span style=\"color: #007700\">\"settings\"<\/span>: {\r\n      <span style=\"color: #007700\">\"enableAutoRecovery\"<\/span>: <span style=\"color: #008800;font-weight: bold\">true<\/span>\r\n   }\r\n}\r\n<\/pre>\n<\/div>\n<p>On this example we need 3 PBIP files, but as you may be noticing, they are very simple.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"267\" height=\"264\" class=\"wp-image-101673\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/03\/a-screenshot-of-a-computer-description-automatica-3.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>Once we create the PBIPs, we can open them in Power BI Desktop and manage the report and semantic model as usual.<\/p>\n<p>It&#8217;s interesting to notice the \u201c<strong><em>.gitignore\u201d<\/em><\/strong> file is also missing, but once we open a PBIP and save it, even without changing anything, a \u201c.gitignore\u201d file is created.<\/p>\n<p>We need to push these PBIPs to the repository, so any other developer cloning the repository will have the PBIPs available. The portal will, in fact, ignore these files. It shows the objects based on the folders.<\/p>\n<p>It&#8217;s also important to notice that some changes to the report made on the portal may create an incompatibility with Power BI Desktop. The features on the portal and the features on the desktop version aren&#8217;t always aligned.<\/p>\n<h2>Edit on May 3rd, 2024<\/h2>\n<p>Each report folder contains a PBIR file. Power BI can open a PBIR file directly and it has the same effect as opening a PBIP.<\/p>\n<p>The PBIP exists as a matter of organization, to help creating a better understanding of the process. However, it&#8217;s needless. You can use the PBIR directly, without creating a PBIP.<\/p>\n<p>In this way, using the process of reverse creating the PBIP is an optional process.<\/p>\n<p>&nbsp;<\/p>\n<h2>Additional Reference<\/h2>\n<p>You may would like to watch the video: <a href=\"https:\/\/www.youtube.com\/watch?v=7ZDLySKy8eg\">Fabric Monday 19: Reverse Create the PBIP<\/a><\/p>\n<h2>Summary<\/h2>\n<p>If we start the source control from the workspace instead of the local machine, the PBIP file are not created for you. You need to manually create them in a process I call Reverse Creating the PBIP.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On my article about Source Control with GIT, Power BI and Microsoft Fabric, I illustrate how to use the PBIP file\u00a0format to include Power BI reports and semantic models in a source control process and stablish a SDLC (Software Development Lifecycle) for Power BI. However, the complete explanation is based on saving the development using&#8230;&hellip;<\/p>\n","protected":false},"author":50808,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,159164,159166],"tags":[4963,158997,101611,4179],"coauthors":[6810],"class_list":["post-101669","post","type-post","status-publish","format-standard","hentry","category-blogs","category-microsoft-fabric","category-powerbi","tag-git","tag-microsoft-fabric","tag-power-bi","tag-source-control"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/50808"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=101669"}],"version-history":[{"count":6,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101669\/revisions"}],"predecessor-version":[{"id":102320,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101669\/revisions\/102320"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=101669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=101669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=101669"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=101669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}