Showing results for 
Search instead for 
Did you mean: 
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>"
ws <- workspace(wsid,auth)
ds <- consume(services(ws, name = serviceName),dataset)




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

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

Execution halted




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.

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

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!