microsoft / microsoft/azure-devops-python-api
Cannot get accounts list for a multi-organization access token
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 684
- 派生
- 218
- 平均合并
- 8 天 10 小时
- 30 天内合并 PR
- 1
描述
Hello,
We have the following sample of code we use to list the accounts of a Token "accessible to all organizations". It was working until October 7th. After digging a little deeper into the library, it's trying to get the /_apis/ResourceAreas to presumably get the URLS to the accounts endpoint and calling it directly results in a 500 Internal error after 100 seconds with this payload
{
"$id": "1",
"innerException": null,
"message": "The remote name could not be resolved: 'dpdbotprodwus30.dpdbot.visualstudio.com'",
"typeName": "System.Net.Http.HttpRequestException, System.Net.Http",
"typeKey": "HttpRequestException",
"errorCode": 0,
"eventId": 0
}
Sample code
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
credentials = BasicAuthentication("", token)
connection = Connection(base_url="https://app.vssps.visualstudio.com", creds=credentials)
location_client = connection.clients_v6_0.get_location_client()
accounts_client = connection.clients_v6_0.get_accounts_client()
connection_data = location_client.get_connection_data()
authenticated_user = connection_data.authenticated_user
# This hangs
accounts = list(accounts_client.get_accounts(member_id=authenticated_user.id))
print(accounts)
Is there an issue on the Azure side ? Or perhaps a better way to get the list of accounts for a multi-org personal access token?
Thank you
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 azure.devops.connection.Connection 重现示例,获取 get_location_client() 和 get_accounts_client(),然后检查 ResourceAreas 请求和 accounts 客户端路径。将失败的响应与 Azure DevOps 文档中说明的帐户列表行为进行比较。确定故障是服务端问题,或找出适用于多组织令牌的受支持客户端/API 路径,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- azure, python
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100