Forum Discussion

Allen_Johnson's avatar
Allen_Johnson
Copper Contributor
Feb 03, 2023
Solved

PAT can only access _apis/resources/Containers with Full Access, not a custom scope

I am trying to download a specific file from a build pipeline artifact using the following API call, where I retrieved the ArtifactId from a previous call: https://dev.azure.com/$($companyname)/$($p...
  • Robina's avatar
    Feb 05, 2023
    To resolve the 401 unauthorized error with a custom access scope PAT, you can try giving the PAT access to the specific API endpoint that you are trying to access. The API endpoint for downloading a specific file from a build pipeline artifact is "/_apis/resources/Containers/$($ArtifactId)". To grant access to this API endpoint, you can go to Azure DevOps, navigate to your project settings, select "Security", and then add the scope for this API endpoint under the "Permissions" section. Make sure the PAT has at least read access to the API endpoint and try again.

Resources