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