admin管理员组文章数量:1410725
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
本文标签:
版权声明:本文标题:Powershell function to invoke compiling Power BI Projects to Report files and deploy to On-Prem Report Server via DevOps Pipelin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744840579a2627900.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论