I am Trying to automate the approval of Pull request from logic app using "Send a HTTP Request to DevOps" action. Getting below authentication error.
Tried below options but nothing worked.
- Created new PAT with Full Access and passed to header.
- Enabled "Third-party application access via OAuth" in org policies
- Tried Basic, Bearer authentication
Error: { "status": 401, "message": "TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.\r\nAzure DevOps ActivityId: abcd1234-ac34-ac34-abcd1234\r\nDetails: {\"$id\":\"1\",\"innerException\":null,\"message\":\"TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.\",\"typeName\":\"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server\",\"typeKey\":\"UnauthorizedRequestException\",\"errorCode\":0,\"eventId\":3000}\r\nclientRequestId: abcd1234-ac34-ac34-abcd1234", "error": { "message": "TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.\r\nAzure DevOps ActivityId: abcd1234-ac34-ac34-abcd1234\r\nDetails: {\"$id\":\"1\",\"innerException\":null,\"message\":\"TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.\",\"typeName\":\"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server\",\"typeKey\":\"UnauthorizedRequestException\",\"errorCode\":0,\"eventId\":3000}" }, "source": "vsts-eus.azconn-eus-003.p.azurewebsites.net" }
CodePudding user response:
You need to make sure you encode the PAT to base64 with no username when using basic auth in Azure DevOps.