Search code examples
azureazure-devopsautomationazure-logic-appspower-automate

Getting authentication Error when using "Send a HTTP Request to DevOps" from LogicApp


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.

  1. Created new PAT with Full Access and passed to header.
  2. Enabled "Third-party application access via OAuth" in org policies
  3. Tried Basic, Bearer authentication

enter image description here

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" }


Solution

  • You need to make sure you encode the PAT to base64 with no username when using basic auth in Azure DevOps.