microsoft / microsoft/azure-devops-python-api
build.get_artifact_content_zip() returns TF400813 error
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 684
- Forks
- 218
- Merge medio
- 8 d 10 h
- PR fusionados (30 d)
- 1
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en azure-devops/azure/devops/v7_1/build/build_client.py y reproduce la llamada exitosa a get_artifact junto con get_artifact_content_zip usando los valores indicados de proyecto, build y artefacto. Compara cómo los dos puntos de entrada gestionan la autorización y el acceso al artefacto. Se considera terminado cuando la solicitud zip funciona con el ámbito Build Read PAT indicado, o cuando se identifican claramente la limitación y el permiso requerido.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, python
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100