question

Eric-4026 avatar image
0 Votes"
Eric-4026 asked JT-3989 commented

azuremlsdk for R error Could not retrieve user token. Please run 'az login'

I'm trying to create a workspace in azure machine learning and receiving this error after 2 browser Windows open and I click log in.

library(azuremlsdk)
new_ws <- create_workspace(name = 'muffin',

+ subscription_id = 'XXXXXXXXXXXX',
+ resource_group = 'white',
+ location = 'eastus2',
+ create_resource_group = T)
Note, we have launched a browser for you to login. For old experience with device code, use "az login --use-device-code"
You have logged in. Now let us find all the subscriptions to which you have access...
Note, we have launched a browser for you to login. For old experience with device code, use "az login --use-device-code"
You have logged in. Now let us find all the subscriptions to which you have access...
Error in py_call_impl(callable, dots$args, dots$keywords) :
AuthenticationException: AuthenticationException:
Message: Could not retrieve user token. Please run 'az login'
InnerException It is required that you pass in a value for the "algorithms" argument when calling decode().
ErrorResponse
{
"error": {
"code": "UserError",
"inner_error": {
"code": "Authentication"
},
"message": "Could not retrieve user token. Please run 'az login'"
}
}


how do I get passed this error?
azure-machine-learning
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey Eric,

Cleaning the cookies and restart may help to this situation. Have you tried?


Regards,
Yutong

0 Votes 0 ·

I just tried restarting my computer, clearing cookies, and using a different browser. I'm still getting the same error

Error in py_call_impl(callable, dots$args, dots$keywords) :
AuthenticationException: AuthenticationException:
Message: Could not retrieve user token. Please run 'az login'
InnerException It is required that you pass in a value for the "algorithms" argument when calling decode().
ErrorResponse
{
"error": {
"code": "UserError",
"inner_error": {
"code": "Authentication"
},
"message": "Could not retrieve user token. Please run 'az login'"
}
}

0 Votes 0 ·

I'm getting the same error :(

0 Votes 0 ·

1 Answer

Eric-4026 avatar image
0 Votes"
Eric-4026 answered JT-3989 commented

You have to use this command to make it install the correct version of miniconda reticulate::py_install("PyJWT==1.7.1"). If you don't do that it seems to install the wrong version. I also had to manually delete the r-miniconda folder in \appdata\local\r-miniconda which got installed previously to get it to install the correct version. It's pretty outrageous they leave that out of the tutorial when it ain't going to work otherwise.

If you try to do the accident.R tutorial for azuremlsdk-r next make sure you add the line

interactive_auth <- interactive_login_authentication(tenant_id="<tenant id>")

to your code otherwise you'll get a permissions error and it won't work.

Then to the create_workspace or get_workspace function you have to add auth = interactive_auth after a comma.

It should look like this

new_ws <- get_workspace(name = "<workspace name>",
subscription_id = "<subscription id>",
resource_group = "<resource name>",
auth = interactive_auth)

To find the tenant ID I had to download the azure CLI and run the command az login. Not sure if there is another way to find a tenant ID or not.


To leave out critical steps from a tutorial is gross incompetence on the part of Azure. How anyone who isn't a comp sci phd uses this service is a mystery to me.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the feedback and sorry for your experience. I have reached out to the content team for this issue. There will be a update for this document soon.


Regards,
Yutong

0 Votes 0 ·

Thank you! that works :D

0 Votes 0 ·