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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
FaCoffee
New Member

DataSource.Error: ADO.NET: R script error. HTTPS code: 401

I was following this tutorial about how to use a pre-published Machine Learning Studio web service to score a bunch of rows in Power BI.

 

I am using an R script with the correct workspace id (wsid) and authentication code (authorization token) of my Machine Learning Studio web service. 

 

The R script is the following:

 

 

wsid = "<mywsid>"
 
auth = "<myauthtoken>"
          
serviceName = "<myservicename>"
 
library("AzureML")
 
ws <- workspace(wsid,auth)
ds <- consume(services(ws, name = serviceName),dataset)
ds<-data.frame(ds,dataset)
#output<-data.frame(ds$Sentiment,ds$Score)

 

 

 

However, when I run my R script I get the following error:

 

 

DataSource.Error: ADO.NET: R script error.
Error: AzureML returns error code:
HTTP status code : 401



Execution halted

Details:
    DataSourceKind=R
    DataSourcePath=R
    Message=R script error.
Error: AzureML returns error code:
HTTP status code : 401



Execution halted

    ErrorCode=-2147467259
    ExceptionType=Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException

 

 

What am I doing wrong? I feel like this might be an authentication problem (code 401), but in the tutorial I mentioned, this does not happen.

2 REPLIES 2
dax
Community Support
Community Support

Hi @FaCoffee , 

Please checkwhether you install the AzureML package in your local R (or server) using install.packages command, and you also need to checkwhether your workspace , service name and authenticaltion token are correct.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi all, I checked these and they are all correct, but the error still remains.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.

Top Kudoed Authors