microsoft / microsoft/azure-devops-python-api

build.get_artifact_content_zip() returns TF400813 error

未關閉
#508 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
684
分支
218
平均合併
8 天 10 小時
30 天內合併 PR
1

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 azure-devops/azure/devops/v7_1/build/build_client.py 開始,使用所回報的專案、組建和成品值,重現成功的 get_artifact 呼叫以及 get_artifact_content_zip。比較兩個進入點如何處理授權和成品存取。完成的標準是:zip 要求能使用所述的 Build Read PAT 範圍正常運作,或明確確認限制和所需的權限。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。