microsoft / microsoft/azure-devops-python-api

build.get_artifact_content_zip() returns TF400813 error

Đang mở
#508 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

I reported this issue with Azure support and they asked me to contact the product team directly.

I'm using a PAT which has the Build Read scope

7.1.0b4 version of the Devops library is installed as a dependency

----------------------------------
Installing dependencies
----------------------------------
Requirement already satisfied: azure-devops in ./venv/lib/python3.12/site-packages (from -r requirements.txt (line 1)) (7.1.0b4)

I will be referring to functions in https://github.com/microsoft/azure-devops-python-api/blob/dev/azure-devops/azure/devops/v7_1/build/build_client.py

I am able to call the following function get_artifact("dev-control-plane-deployments", 689011, artifact_name="output") and get a successful response as follows,

{'additional_properties': {}, 'id': 244186, 'name': 'output', 'resource': <azure.devops.v7_0.build.models.ArtifactResource object at 0x10580e5a0>, 'source': '6f0348f4-34df-5a9a-6f7a-f9fecb8e1bf8'}

However when I try to download the artifact zip using get_artifact_content_zip("dev-control-plane-deployments", 689011, artifact_name="output") I get the following error response

TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.

Please help me find a solution so I can use get_artifact_content_zip() to download the artifact zip file

Note that I am able to download the artifact directly from the pipeline run via the web browser, its just the API call that does not seem to work

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong azure-devops/azure/devops/v7_1/build/build_client.py và tái hiện lệnh gọi get_artifact thành công cùng với get_artifact_content_zip bằng các giá trị project, build và artifact được nêu. So sánh cách hai điểm đầu vào xử lý việc ủy quyền và truy cập artifact. Được xem là hoàn tất khi yêu cầu zip hoạt động với phạm vi Build Read PAT đã nêu, hoặc khi giới hạn và quyền cần thiết được xác định rõ ràng.

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.