Forum Discussion
Quick Fix for OAuth2 or “Organizational Account” Authentication Support in Power BI Report Server
- 1 year ago
Hi mvyas,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power BI Report Server (PBIRS) does not support OAuth2 (including "Organizational Account") authentication for scheduled data refreshes. Below are the few workaround you can try:
1)Use Scheduled Data Export with Power Automate or PowerShell:
- Set up a Power Automate flow to export SharePoint Online List/Excel content to a OneDrive or File Share.
- Use a script or task scheduler to download the data from OneDrive to your on-prem folder.
- In Power BI Desktop (for PBIRS), use the Folder or CSV data source.
- Publish to PBIRS and schedule the refresh using a Windows credential.
2)Store Files Locally via OneDrive Sync:
- Use OneDrive sync client to sync a SharePoint document library locally.
- Point Power BI to the synced folder (e.g., C:\Users\YourName\SharePoint Docs.)
- Schedule refresh in PBIRS as it's now reading a local file (Windows auth works).
PowerShell Script to Export SharePoint List to CSV:
Install-Module -Name "PnP.PowerShell" -Force -Scope CurrentUser
# Define variables
$siteUrl = "https://yourtenant.sharepoint.com/sites/yoursite"
$listName = "YourListName"
$outputCsvPath = "C:\PBIRSData\SharePointData.csv"# Connect to SharePoint Online
Connect-PnPOnline -Url $siteUrl -Interactive# Get list items (you can use -PageSize and -Fields if needed)
$listItems = Get-PnPListItem -List $listName -PageSize 500# Convert to CSV format
$data = $listItems | ForEach-Object {
$item = $_.FieldValues
[PSCustomObject]@{
ID = $item["ID"]
Title = $item["Title"]
Created = $item["Created"]
Modified = $item["Modified"]
Status = $item["Status"] # Example custom field
AssignedTo = $item["AssignedTo"] # Example custom field
}
}# Export to CSV
$data | Export-Csv -Path $outputCsvPath -NoTypeInformation -Encoding UTF8Write-Host "Data exported successfully to $outputCsvPath"
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Chaithanya.
Hi @mvyas ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithanya.