我已经在我们的azure环境中创建了一个工作区,并尝试运行以下代码:
library(azuremlsdk)
ws <- get_workspace(
name = "someworkspace",
subscription_id = "si1",
resource_group ="rg1"
)在我的浏览器中打开了一些交互式身份验证程序,我认为这是有意为之的行为,因为我没有租户身份。然而,我得到的是:
Performing interactive authentication. Please follow the instructions on the terminal.
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...
Interactive authentication successfully completed.
Performing interactive authentication. Please follow the instructions on the terminal.
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...
Interactive authentication successfully completed.
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'"
}
}我也尝试过:
az login这可以很好地工作。所以对我来说,这一切都非常令人困惑!
发布于 2021-05-12 00:56:00
因此,我在Python中尝试了同样的方法,并遇到了类似的错误,并遇到了以下内容:
https://github.com/Azure/azure-sdk-for-python/issues/16035
降级:
PyJWT 帮上忙了。奇怪的开源世界及其相互依赖的网络!
发布于 2021-06-23 16:45:28
正如@cs0815提到的,这个Github问题帮助我解决了这个问题:https://github.com/Azure/azure-sdk-for-python/issues/16035
我做了什么来解决这个问题?
1.检查包版本
当我运行以下命令时,我使用的是azure-core版本1.15.0:
pip show azure-core当我运行以下命令时,我的PyJWT是2.1.0:
pip show PyJWT2.将PyJWT降级至1.7.1
为此,我运行以下命令:
python -m pip install --upgrade PyJWT==1.7.13.检查工作空间连接
我运行此Python脚本以连接到我的Azure机器学习工作区:
import azureml.core
from azureml.core import Workspace
print("Ready to use Azure ML", azureml.core.VERSION)
#Store first the workspace connection information in a JSON.
#This can be downloaded from the Azure portal or the workspace details
#pane in Azure Machine Learning studio.
ws = Workspace.from_config('config.json')
print(ws.name, "loaded")https://stackoverflow.com/questions/67488064
复制相似问题