{"id":1588,"date":"2026-03-28T18:33:45","date_gmt":"2026-03-28T16:33:45","guid":{"rendered":"https:\/\/www.flip-design.de\/?p=1588"},"modified":"2026-03-28T18:33:45","modified_gmt":"2026-03-28T16:33:45","slug":"installation-deployment-of-power-bi-projects-with-powershell","status":"publish","type":"post","link":"https:\/\/www.flip-design.de\/?p=1588","title":{"rendered":"Installation \/ Deployment of Power BI Projects with PowerShell"},"content":{"rendered":"\n<p>Three years ago, I spoke about CI\/CD for Power BI projects at the Power BI Summit. Afterwards, I was asked whether it would also be possible to automatically deploy projects using PowerShell, for example via Azure DevOps or GitHub, without Fabric. I was quite optimistic that this would be available soon. Unfortunately, that did not seem to be the case\u2026<\/p>\n\n\n\n<p>However, good news: this is now possible:<br><a href=\"https:\/\/learn.microsoft.com\/en-us\/rest\/api\/fabric\/articles\/get-started\/deploy-project\">https:\/\/learn.microsoft.com\/en-us\/rest\/api\/fabric\/articles\/get-started\/deploy-project<\/a><\/p>\n\n\n\n<p>The good thing is that no Fabric capacity is required for this. It also works with a standard Pro license. However, it is recommended to have a Service Principal. Otherwise, you would need to log in manually multiple times, which is not recommended. I described how this works in the following post:<br><a href=\"https:\/\/www.flip-design.de\/?p=1578\">https:\/\/www.flip-design.de\/?p=1578<\/a><\/p>\n\n\n\n<p>I would like to explain how this works here. First, I installed the latest Power BI Management cmdlets. The current version is 1.3.83. If you install them via PowerShell, the latest version is automatically installed. Additionally, version Az.Accounts 5.3.3 (or newer) is required.<\/p>\n\n\n\n<p>You will also need the following packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"MSAL.PS\\msal.ps.4.37.0.nupkg\",\r\n\"AzAccounts\\az.accounts.5.3.3.nupkg\",\r\n\"fabtools\\fabtools.0.7.0.4.nupkg\",\r\n\"fabric\\az.fabric.1.0.0.nupkg\",\r\n\"AzResources\\az.resources.9.0.0.nupkg\"<\/code><\/pre>\n\n\n\n<p>After that, everything is up to date. I then created a simple Power BI project as well as a workspace where my Service Principal has admin permissions.<\/p>\n\n\n\n<p>Next, I stored the following PowerShell script locally \u2013 next to the folder where my project is located \u2013 as well as the PowerShell script from the Microsoft link above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ErrorActionPreference = \"Stop\"\r\n\r\n$modulePath = \"C:\\temp\\FabricPS-PBIP\\FabricPS-PBIP.psd1\"\r\n$pbipPath   = \"C:\\temp\\test\"\r\n$wsName     = \"PowerBIServiceAccount\"\r\n\r\n$tenantId     = \"\"\r\n$clientId     = \"\u201d\r\n$clientSecret = \"\"\r\n\r\nif (-not (Test-Path $modulePath)) {\r\n   throw \"FabricPS-PBIP Modul nicht gefunden: $modulePath\"\r\n}\r\n\r\nif (-not (Test-Path $pbipPath)) {\r\n    throw \"PBIP-Pfad nicht gefunden: $pbipPath\"\r\n}\r\n\r\nImport-Module MicrosoftPowerBIMgmt.Profile -Force\r\nImport-Module MicrosoftPowerBIMgmt.Workspaces -Force\r\nImport-Module $modulePath -Force\r\n\r\n$secureSecret = ConvertTo-SecureString $clientSecret -AsPlainText -Force\r\n$credential   = &#91;System.Management.Automation.PSCredential]::new($clientId, $secureSecret)\r\n\r\nConnect-PowerBIServiceAccount -ServicePrincipal -Tenant $tenantId -Credential $credential\r\n\r\n$null = Get-PowerBIAccessToken\r\n\r\n$ws = Get-PowerBIWorkspace -Name $wsName -ErrorAction Stop\r\nif (-not $ws -or -not $ws.Id) {\r\n    throw \"Workspace '$wsName' wurde nicht gefunden oder hat keine Id.\"\r\n}\r\n\r\n$wsId = $ws.Id\r\n\r\nSet-FabricAuthToken -servicePrincipalId $clientId -servicePrincipalSecret $clientSecret -tenantId $tenantId -reset\r\n\r\nImport-FabricItems -workspaceId $wsId -path $pbipPath <\/code><\/pre>\n\n\n\n<p>The script shown above can now be executed with standard user permissions.<\/p>\n\n\n\n<p>It is important that all installations and executions are performed using PowerShell 7.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-7.png\"><img decoding=\"async\" loading=\"lazy\" width=\"940\" height=\"451\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-7.png\" alt=\"\" class=\"wp-image-1589\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-7.png 940w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-7-300x144.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-7-768x368.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Before:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-8.png\"><img decoding=\"async\" loading=\"lazy\" width=\"940\" height=\"463\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-8.png\" alt=\"\" class=\"wp-image-1590\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-8.png 940w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-8-300x148.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-8-768x378.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p><strong>After:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-9.png\"><img decoding=\"async\" loading=\"lazy\" width=\"940\" height=\"463\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-9.png\" alt=\"\" class=\"wp-image-1591\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-9.png 940w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-9-300x148.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2026\/03\/image-9-768x378.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Conclusion:<\/strong><br>This is an excellent way to implement CI\/CD pipelines for Power BI projects using PowerShell.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Three years ago, I spoke about CI\/CD for Power BI projects at the Power BI Summit. Afterwards, I was asked whether it would also be possible to automatically deploy projects using PowerShell, for example via Azure DevOps or GitHub, without &hellip; <a href=\"https:\/\/www.flip-design.de\/?p=1588\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1588"}],"collection":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1588"}],"version-history":[{"count":1,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1588\/revisions"}],"predecessor-version":[{"id":1592,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1588\/revisions\/1592"}],"wp:attachment":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}