We have just put our Power BI reports (PBIX files) into a Git Repo as Power BI Projects (PBIP project folders) and I've started building out a DevOps Release Pipeline to release the reports to a test server. In Microsoft docs I can see that you can deploy PBIX report files. Is there a function I can invoke to transform from a project to a report file and deploy to the server?
Any help is appreciated.
Thanks, Dan
PowerShell Script
Get-ChildItem -Path "$FolderPath\*.pbix" | ForEach-Object {
$ReportName = $_.Name
Write-Host "Deploying $ReportName to $ReportServerURL"
Invoke-WebRequest -Uri "$ReportServerURL/api/v2.0/CatalogItems" `
-Method Post `
-Credential $cred `
-InFile $_.FullName `
-ContentType "application/octet-stream"
}
DevOps Pipeline
trigger:
- main
stages:
- stage: Build
displayName: 'Build Reports'
jobs:
- job: Build
displayName: 'Validate'
pool:
name: 'Self-Hosted'
steps:
- checkout: self
- task: PublishBuildArtifacts@1
displayName: 'Publish Reports as Artifacts'
inputs:
artifactName: 'PBIReports'
pathToPublish: '$(Build.SourcesDirectory)'
- stage: Deploy
displayName: 'Deploy to Report Server'
jobs:
- deployment: DeployPBIRS
displayName: 'Deploy Reports to PBIRS'
environment: Test
pool:
name: 'Self-Hosted'
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: 'PBIReports'
- task: PowerShell@2
displayName: 'Deploy Reports to PBIRS'
inputs:
filePath: '$(Pipeline.Workspace)/PBI.ps1'
arguments: '-ReportServerURL "http://your-pbirs-server/reports" -FolderPath "$(Pipeline.Workspace)/Reports" -Username "admin" -Password "$(PBIRSPassword)"'
failOnStderr: true
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744840579a4596533.html
评论列表(0条)