获取工作区失败的 azuremlsdk - AuthenticationException
get workspace failed azuremlsdk - AuthenticationException
我已经在我们的天蓝色环境中创建了一个工作区并尝试运行此代码:
library(azuremlsdk)
ws <- get_workspace(
name = "someworkspace",
subscription_id = "si1",
resource_group ="rg1"
)
一些交互式身份验证器在我的浏览器中打开,我认为这是预期的行为,因为我没有 tenantdid。但是,我明白了:
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
这很好用。所以对我来说这一切都非常混乱!
所以我在 Python 中尝试了同样的方法并遇到了类似的错误并遇到了这个:
https://github.com/Azure/azure-sdk-for-python/issues/16035
降级:
PyJWT
有帮助。奇异的开源世界及其相互依赖的网络!
正如@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 PyJWT
2。将 PyJWT 降级到 1.7.1
为此,我 运行 这个命令:
python -m pip install --upgrade PyJWT==1.7.1
3。检查工作区连接
我 运行 这个 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")
我已经在我们的天蓝色环境中创建了一个工作区并尝试运行此代码:
library(azuremlsdk)
ws <- get_workspace(
name = "someworkspace",
subscription_id = "si1",
resource_group ="rg1"
)
一些交互式身份验证器在我的浏览器中打开,我认为这是预期的行为,因为我没有 tenantdid。但是,我明白了:
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
这很好用。所以对我来说这一切都非常混乱!
所以我在 Python 中尝试了同样的方法并遇到了类似的错误并遇到了这个:
https://github.com/Azure/azure-sdk-for-python/issues/16035
降级:
PyJWT
有帮助。奇异的开源世界及其相互依赖的网络!
正如@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 PyJWT
2。将 PyJWT 降级到 1.7.1
为此,我 运行 这个命令:
python -m pip install --upgrade PyJWT==1.7.1
3。检查工作区连接
我 运行 这个 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")