Skip to content

build.get_artifact_content_zip() returns TF400813 error #508

@uvindra

Description

@uvindra

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

Activity

uvindra

uvindra commented on Oct 7, 2024

@uvindra
Author

Seems this is similar to what was faced in #316. I used the same workaround mentioned there to get around this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @uvindra

        Issue actions

          build.get_artifact_content_zip() returns TF400813 error · Issue #508 · microsoft/azure-devops-python-api