microsoft / microsoft/azure-devops-python-api
build.get_artifact_content_zip() returns TF400813 error
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 684
- Forks
- 218
- Merge médio
- 8d 10h
- PRs com merge (30d)
- 1
Descrição
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
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece em azure-devops/azure/devops/v7_1/build/build_client.py e reproduza a chamada bem-sucedida de get_artifact junto com get_artifact_content_zip usando os valores informados de projeto, build e artefato. Compare como os dois pontos de entrada lidam com autorização e acesso ao artefato. Está concluído quando a solicitação zip funcionar com o escopo Build Read PAT informado, ou quando a limitação e a permissão necessária forem claramente identificadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- azure, python
- Domínio
- api
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100