question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calling HTTP with Azure AD with Asynchronous Pattern enabled fails with 401 when Location is returned

See original GitHub issue

I have a following scenario:

Logic App calls Azure Resource Manager API PATCH operation which results with HTTP 202 and Location header returned. When I have asynchronous pattern enabled, the first request (PATCH) succeeds and returns Location header (pointing to ARM API) and Retry-After (10) which fails with 401 error:

{
  "error": {
    "code": "AuthenticationFailed",
    "message": "Authentication failed. The 'Authorization' header is missing."
  }
}

The issue is that when the connector follows the Location it omits the Authorization header and the overall operation fails. The workaround (from case 2209090010001308) is to disable Asynchronous Pattern and follow the requests manually via Until loop, which adds to complexity of the Logic App.

Is this desired behavior (I suppose it should be documented then) or is it a bug? I would classify it as a bug since when I have AAD protected API, I expect to protect all endpoints with it, even the endpoint from Location header.

AB#15942596

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
rohithahcommented, Jan 26, 2023

This is a bug in the ARM connector that we will be fixing. Rough ETA is end of March. Hopefully, you can workaround this using the HTTP action until we have the fix in place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure AD API request 401 Unauthorized
The issue appears to be with the "Authentication / Authorization" option in Azure Websites, when enabled the Web Api will not accept ...
Read more >
Call service endpoints by using HTTP or HTTPS - Azure ...
Asynchronous request-response behavior​​ This pattern specifies that after an HTTP action calls or sends a request to an endpoint, service, ...
Read more >
401 error when you use Graph API to access OneDrive ...
Describes an issue in which you receive 401 Unauthorized error message when you use Microsoft Graph API to query OneDrive resources.
Read more >
HTTP with Azure AD - Connectors
Use the HTTP connector to fetch resources from various Web services, ... The asynchronous pattern based on the response Location header is not...
Read more >
Troubleshooting in Azure Communication Services
File a support request through the Azure portal. Check error message and confirm the audio file format is valid (WAV, 16KHz, Mono), if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found