User Profile
GuillermoAM
Frequent Visitor
Joined 3 years ago
User Widgets
Contributions
Re: Paginated Report Owner - Set to Service Principal in Prod Stage using Power BI Deployment Pipelines
Hi AHark1 , here you have the script I use to deploy all the paginated reports from DEV to TEST: # Base API for Power BI REST API $BasePbiRestApi = "https://api.powerbi.com/v1.0/myorg/" # Load the JSON configuration file #Configuration setting the Json as env variable: $jsonConfig = Get-Content -Raw -Path $env:POWERSHELL_CONFIG_PATH | ConvertFrom-Json # PBI connection with Service Principal $appId = $jsonConfig.SPI_app_ID $tenantID = $jsonConfig.AzureActiveDirectory_TenantID $appSecret = $jsonConfig.SPI_secret $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $appId, ($appSecret | ConvertTo-SecureString -AsPlainText -Force) Connect-PowerBIServiceAccount -ServicePrincipal -Tenant $tenantID -Credential $credential # Workspace to be checked $WorkspaceId = "2e5aa952-45b0-414d" $PipelineId = "a6e40919-ee24-4fff" # Endpoint to fetch Paginated Reports $endpoint = $BasePbiRestApi + "groups/" + $WorkspaceId + "/reports" # Get the reports $Reports = Invoke-PowerBIRestMethod -Method GET -Url $endpoint | ConvertFrom-Json # Filter by Paginated Reports and start with PR_ $PaginatedReports = $Reports.value | Where-Object {$_.reportType -eq "PaginatedReport" -and $_.name -like "PR_Accounting_wbw_per_time_bucket*"} # Extract Report IDs and format them into a JSON array $ReportIds = @() foreach ($report in $PaginatedReports) { $ReportIds += @{ sourceId = $report.id } } # Prepare JSON body $Body =[ordered] @{ sourceStageOrder = 0 reports = $ReportIds options = @{ allowOverwriteArtifact = $true allowCreateArtifact = $true } note = "Deploying Paginated Reports starting with PR_" } | ConvertTo-Json -Depth 3 -Compress Write-Host $Body # Deploy endpoint $DeployEndpoint = $BasePbiRestApi + "pipelines/" + $PipelineId + "/deploy" # Deploy the filtered reports $DeployResponse = Invoke-PowerBIRestMethod -Method POST -Url $DeployEndpoint -Body $Body -ContentType "application/json" Important considerations, I am using a json file to store the credentials. Remember to change sourceStageOrder depending on the stage from you want to deploy (0 means DEV, 1 means UAT) Regards823Views0likes0CommentsRe: Deploy Power Bi report with Paginated Report and Power Apps visuals among workspaces (DEV-TEST-PRD)
Hi Anonymous , Thanks for your answer. Maybe I did not explain well my problem. I have a report and a paginated report up and running in my DEV workspace. The Power Bi report has an embedded Paginated Report visual working fine. Using deployment pipelines, I deploy my report and paginated report to my TEST workspace. It implies changing the data source for both of them. All works fine except my embedded paginated report visual. It is still pointing to the DEV workspace Paginated Report.690Views0likes0CommentsDeploy Power Bi report with Paginated Report and Power Apps visuals among workspaces (DEV-TEST-PRD)
This is the situation, i have 3 workspaces (DEV-TST-PRD), Power Bi report, Paginated Reports and also the same structure in Power Apps with 3 environments and the same app in each one of them. In my development pipeline into PowerBi service i have the rules to change the servers depending on the workspace. I have a problem when I try to deploy a report from my Dev workspace to my Test workspace, all the Paginated report visuals remain linked to the Dev workspace. The same situation with the Power Apps visual. I have to change all of them manually ( I have like 15 paginated reports) With the pbip format, I have been able to change at least the power apps visual, just by finding the Power App Dev id and replace in the report.json file by the Power App Test id, but I am a bit concerned as pbip is still in preview and the process is also a manual change.737Views0likes2Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.