microsoft / microsoft/azure-devops-python-api
build.get_artifact_content_zip() returns TF400813 error
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 684
- Forks
- 218
- Merge moyen
- 8 j 10 h
- PR mergées (30 j)
- 1
Description
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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez dans azure-devops/azure/devops/v7_1/build/build_client.py et reproduisez l’appel réussi à get_artifact avec get_artifact_content_zip en utilisant les valeurs indiquées pour le projet, le build et l’artefact. Comparez la manière dont les deux points d’entrée gèrent l’autorisation et l’accès à l’artefact. C’est terminé lorsque la requête zip fonctionne avec le scope Build Read PAT indiqué, ou lorsque la limitation et l’autorisation requise sont clairement identifiées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, python
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100