Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to deploy .pbix extension on Power BI Report Server from Team Foundation Server (TFS) and getting this error:
Error Uploading or saving files with .pbix extension is not allowed. Contact your administrator if you have any questions.
First thing would like to know is it possible to deploy .pbix extension on Power BI Report Server from Team Foundation Server (TFS)? If not then how can I deploy 100 of .pbix reports to prod..? Pls don't say 1 by 1 and manually.
Solved! Go to Solution.
Import-Module ReportingServicesTools
$vReportServerURI = 'http://Server/Reports/'
$vRSRootFolderName = '/ABC' # /=Home and /Folder1=Folder1
$vRSFolderName = 'YYY'
$vSourceFolderPath = 'C:\MyFolder\PowerShellSource\'
$vDescription = "Deployed Power BI Report Using PowerShell"
$vDestinationFolderPath = $vRSRootFolderName +"/"+ $vRSFolderName
$vSourcePBIXFiles = Get-ChildItem -Path $vSourceFolderPath -Filter *.pbix -Recurse
$session = New-RsRestSession -ReportPortalUri $vReportServerURI
#Create Destination Folder On Power BI Report Server
try
{
New-RsRestFolder -WebSession $session -RsFolder $vRSRootFolderName -FolderName $vRSFolderName -ErrorAction Stop
Write-Host "------------------------->Created folder: $($vRSRootFolderName)/$($vRSFolderName)<-------------------------"
}
catch
{
Write-Host "------------------------->Folder: $($vRSRootFolderName)/$($vRSFolderName) exists<-------------------------"
}
#Upload Copy of PBIX to Destination Folder On Power BI Report Server
foreach ($vPBIXFiles in $vSourcePBIXFiles)
{
Write-Host "------------------------->SourceFilePath: $($vSourceFolderPath)$($vPBIXFiles) DestinationFolderPath: $($vDestinationFolderPath)<-------------------------"
Write-Host "------------------------->DestinationFolderPath: $($vDestinationFolderPath)<-------------------------"
Write-Host "------------------------->PBIXFiles: $($vPBIXFiles)<-------------------------"
try
{
Write-Host "------------------------->Started Uploading file: $vPBIXFiles to destination path: $vDestinationFolderPath on report server $vReportServerURI<-------------------------"
Write-RsRestCatalogItem -WebSession $session -Path "$($vSourceFolderPath)$($vPBIXFiles)" -RsFolder $vDestinationFolderPath -Description $vDescription -Overwrite
Write-Host "------------------------->Completed Uploading file: $vPBIXFiles to destination path: $vDestinationFolderPath on report server $vReportServerURI<-------------------------"
}
catch
{
Write-Warning "Failed to upload the file: $vPBIXFiles to report server $vReportServerURI"
Return
}
}
Import-Module ReportingServicesTools
$vReportServerURI = 'http://Server/Reports/'
$vRSRootFolderName = '/ABC' # /=Home and /Folder1=Folder1
$vRSFolderName = 'YYY'
$vSourceFolderPath = 'C:\MyFolder\PowerShellSource\'
$vDescription = "Deployed Power BI Report Using PowerShell"
$vDestinationFolderPath = $vRSRootFolderName +"/"+ $vRSFolderName
$vSourcePBIXFiles = Get-ChildItem -Path $vSourceFolderPath -Filter *.pbix -Recurse
$session = New-RsRestSession -ReportPortalUri $vReportServerURI
#Create Destination Folder On Power BI Report Server
try
{
New-RsRestFolder -WebSession $session -RsFolder $vRSRootFolderName -FolderName $vRSFolderName -ErrorAction Stop
Write-Host "------------------------->Created folder: $($vRSRootFolderName)/$($vRSFolderName)<-------------------------"
}
catch
{
Write-Host "------------------------->Folder: $($vRSRootFolderName)/$($vRSFolderName) exists<-------------------------"
}
#Upload Copy of PBIX to Destination Folder On Power BI Report Server
foreach ($vPBIXFiles in $vSourcePBIXFiles)
{
Write-Host "------------------------->SourceFilePath: $($vSourceFolderPath)$($vPBIXFiles) DestinationFolderPath: $($vDestinationFolderPath)<-------------------------"
Write-Host "------------------------->DestinationFolderPath: $($vDestinationFolderPath)<-------------------------"
Write-Host "------------------------->PBIXFiles: $($vPBIXFiles)<-------------------------"
try
{
Write-Host "------------------------->Started Uploading file: $vPBIXFiles to destination path: $vDestinationFolderPath on report server $vReportServerURI<-------------------------"
Write-RsRestCatalogItem -WebSession $session -Path "$($vSourceFolderPath)$($vPBIXFiles)" -RsFolder $vDestinationFolderPath -Description $vDescription -Overwrite
Write-Host "------------------------->Completed Uploading file: $vPBIXFiles to destination path: $vDestinationFolderPath on report server $vReportServerURI<-------------------------"
}
catch
{
Write-Warning "Failed to upload the file: $vPBIXFiles to report server $vReportServerURI"
Return
}
}
Hi @Anonymous ,
You can only upload .pbix to Power BI Report Server instead of SQL Server Reporting Services.
If you want to upload all report at once, you can use REST API (refer to this)
Best!
Mark this answer as solutin if this helps,thanks!
I am getting error when try to run this:
$UserName1='domain\usename'
$Password1 ='password'
$folderName = 'Marketing'
$ReportServerURI = 'http://Servername/Reports/'
$folderLocation = '/'
$pbixfile = 'C:\Users\KPIs.pbix'
$description = "Deployed Using PowerShell"
$publishPBIXFileSplat = @{
ReportServerURI = $ReportServerURI
folderLocation = $folderLocation
description = $description
pbixfile = $pbixfile
folderName = $folderName
AuthenticationType = 'Windows'
ConnectionUserName = $UserName1
Secret = $Password1
Verbose = $true
}
Publish-PBIXFile @publishPBIXFileSplat
Error:
Publish-PBIXFile @publishPBIXFileSplat
Publish-PBIXFile : The term 'Publish-PBIXFile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:17 char:1
+ Publish-PBIXFile @publishPBIXFileSplat
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Publish-PBIXFile:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
5 | |
4 | |
2 | |
2 |
User | Count |
---|---|
12 | |
7 | |
7 | |
2 | |
2 |