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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

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.

Anonymous
Not applicable

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.