microsoft / microsoft/azure-devops-python-api
Cannot get accounts list for a multi-organization access token
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 684
- Fork
- 218
- Merge trung bình
- 8 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện mẫu với azure.devops.connection.Connection, lấy get_location_client() và get_accounts_client(), sau đó kiểm tra yêu cầu ResourceAreas và đường dẫn của accounts client. So sánh phản hồi bị lỗi với hành vi được Azure DevOps lập tài liệu khi liệt kê tài khoản. Hoàn tất khi xác định được lỗi nằm phía dịch vụ hay xác định được đường dẫn client/API được hỗ trợ cho token đa tổ chức.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100