Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Alienvolm
Helper IV
Helper IV

Power BI hangs when getting data from R script

Hi, 

 

I have built a script in R that leverages the Graph API to get service O365 status information and then saves that information into an R data frame. I use app authentication. 

 

In RStudio, the script works perfectly but when I use the R Script connector in Power BI to execute it, it just hangs while establishing a connection:

 

R error.png

 

If I save that data frame to an .rds file and use another simple R script to import it to Power Bi, it works. Unfortunately that's not a viable option for me because then I'll need a gateway to refresh the report. 

Any suggestions on how to understand what the issue is? 

 

Thanks in advance! 

2 REPLIES 2
lbendlin
Super User
Super User

Looks like you are doing this in the Power BI service.  Have you tried the same on Power BI Desktop?

 

If I save that data frame to an .rds file and use another simple R script to import it to Power Bi, it works. Unfortunately that's not a viable option for me because then I'll need a gateway to refresh the report. 

If you save the file to a OneDrive/Sharepoint you may not need a gateway to retrieve the file. But whenever you want to run scheduled refresh on R script or Python Script a Personal Gateway is mandatory anyway.

Hi @lbendlin

 

No, this is Power BI Desktop. I just tried in an empty report not to show any report data in my screenshot. 

 

When I tried this I was saving my R script in OneDrive. Using SharePoint is again not an option. I have temporarily resolved by saving the data frame resulting from the script to an Azure Table but I still need to schedule the script with Task Scheduler. This is definetely not what we would like to use for production. 

 

The other thing is that it doesn't seem that the gateway would not work for an R data source, so I would really like to embed the script to simplify the entire architecture. 

 

Is there a place where I can find a log for these connection attempts? I would really like to know what's going wrong...

 

Thank you! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.