cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SettlerOfCatan
Regular Visitor

Upload a Report on a Power BI Report Server with Authentication Type set to "Windows Authentication"

Hello everybody,

we use PowerShell to upload and overwrite Power BI Reports on the Report Server.

This is the command, which we use for both tasks:

 

 

Write-RsRestCatalogItem -WebSession $session -Path $PowerBIReportFilePath -RsFolder $RsFolderName -Overwrite $true

 

 

 

However, it happens that the credentials-settings of an uploaded Report is either

SettlerOfCatan_1-1634206865223.png

or

 

SettlerOfCatan_0-1634206592561.png

 

We wish that for each uploaded or overwritten Report the "Authentication Type" setting is "Windows Authentication" and that the point "As the user viewing the report" is always checked. This is our main objective.

 

To achieve our goal, I added the following lines, after the uploading command (Write-RsRestCatalogItem) from above:

 

 

# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = "Windows"
$dataSource.CredentialRetrieval = "Integrated"
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType PowerBIReport -DataSources $dataSource

 

 

 

Unfortunately, with these commands, we always end up with these settings:

SettlerOfCatan_1-1634206865223.png

 

 

What are the correct commands to set the wished settings with PowerShell?

 

 

With best regards

1 ACCEPTED SOLUTION
SettlerOfCatan
Regular Visitor

According to the official documentation by Microsoft, this is the correct way of doing it:

 

 

# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = 'Integrated'
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType 'PowerBIReport' -DataSources $dataSource

 

 

And it is working fine!

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

That is awesome you did, if you can mark your reply as solution, so others can find your method quickly when researching.

 

Paul Zheng _ Community Support Team

SettlerOfCatan
Regular Visitor

According to the official documentation by Microsoft, this is the correct way of doing it:

 

 

# the value of $PowerBIReportFileNamePathOnRs is something like /Folder/ReportName - without the extension '.pbix'
$dataSource = Get-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs
$dataSource.DataModelDataSource.AuthType = 'Integrated'
Set-RsRestItemDataSource -WebSession $session -RsItem $PowerBIReportFileNamePathOnRs -RsItemType 'PowerBIReport' -DataSources $dataSource

 

 

And it is working fine!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.