Azure 授予 VM 身份
Azure granting VM identity
我是 Azure 的新手,正在尝试通过 Azure tutorial 授予 VM 访问 azure 资源的权限,到目前为止已成功完成:
- 创建身份
- 已将身份分配给 VM
- 授予身份 reader 角色
现在我正在尝试通过 运行 虚拟机中来自 #2 的以下命令获取访问令牌以读取资源(替换 UAMI客户端 ID 以及我从上面的 #1 得到的):
curl -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com/&client_id=<UAMI CLIENT ID>"
这条命令returns:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
我不明白这个“404”是什么意思,谁能帮我理解我做错了什么。
我很确定文档中的步骤是正确的。建议检查您已完成的步骤并重试。您可以在 How to use managed identities for Azure resources on an Azure VM to acquire an access token. You can see the 404 error in the Error Handling 中获得更多详细信息。 Azure 也建议再试一次:
It is recommended to retry if you receive a 404, 429, or 5xx error
code.
正如您显示的错误消息,我认为这可能不是正确服务器的结果 return。您应该检查是否有另一个虚拟机使用该地址。
我是 Azure 的新手,正在尝试通过 Azure tutorial 授予 VM 访问 azure 资源的权限,到目前为止已成功完成:
- 创建身份
- 已将身份分配给 VM
- 授予身份 reader 角色
现在我正在尝试通过 运行 虚拟机中来自 #2 的以下命令获取访问令牌以读取资源(替换 UAMI客户端 ID 以及我从上面的 #1 得到的):
curl -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com/&client_id=<UAMI CLIENT ID>"
这条命令returns:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
我不明白这个“404”是什么意思,谁能帮我理解我做错了什么。
我很确定文档中的步骤是正确的。建议检查您已完成的步骤并重试。您可以在 How to use managed identities for Azure resources on an Azure VM to acquire an access token. You can see the 404 error in the Error Handling 中获得更多详细信息。 Azure 也建议再试一次:
It is recommended to retry if you receive a 404, 429, or 5xx error code.
正如您显示的错误消息,我认为这可能不是正确服务器的结果 return。您应该检查是否有另一个虚拟机使用该地址。