Error Azure Logic App Redirect Method GET Status code 302

Anonymous
2023-11-30T19:44:11.1+00:00

I have a Logic App that is causing issues when using an API Management with a GET method via HTTP. The error details are as follows:

User's image

Ouputs:

{
    "statusCode": 302,
    "headers": {
        "Cache-Control": "no-store, must-revalidate, no-cache",
        "Pragma": "no-cache",
        "Location": "https://spsprodeus23.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2FArauco%2FCL-OPER-LABS%2F_apis%2Fbuild%2Fdefinitions%3Fapi-version%3D6.1-preview.7&redirect=1&hid=3a7161d2-cf06-40a7-af6a-c483944d2e76&context=eyJodCI6MiwiaGlkIjoiYmQ3MjZhMjItYTg4Mi00NmFkLWJiYmItMmRlMzBjYzE3ZjU0IiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2",
        "P3P": "CP=\"CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT\"",
        "Set-Cookie": "VstsSession=%7B%22PersistentSessionId%22%3A%22457cf538-8790-4995-899b-ab084c2fedb8%22%2C%22PendingAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22CurrentAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22SignInState%22%3A%7B%7D%7D;SameSite=None; domain=.dev.azure.com; expires=Fri, 29-Nov-2024 19:13:55 GMT; path=/; secure; HttpOnly",
        "WWW-Authenticate": "Bearer authorization_uri=https://login.microsoftonline.com/79b9de4d-acfd-4ca2-b3ab-a2ce683ab7e1,Basic realm=\"https://tfsprodscussu5.app.visualstudio.com/\"",
        "X-TFS-ProcessId": "f7cdb549-0d26-4f62-9bbc-489aee092737",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "ActivityId": "2ff737a4-de2d-417b-8fb8-4ecc636456fb",
        "X-TFS-Session": "2ff737a4-de2d-417b-8fb8-4ecc636456fb",
        "X-VSS-E2EID": "2ff737a4-de2d-417b-8fb8-4ecc636456fb",
        "X-VSS-SenderDeploymentId": "9990da46-7250-6bf3-cf36-dc074e04863e",
        "X-Frame-Options": "SAMEORIGIN",
        "X-TFS-FedAuthRealm": "https://tfsprodscussu5.app.visualstudio.com/",
        "X-TFS-FedAuthIssuer": "https://dev.azure.com/Arauco/",
        "X-VSS-AuthorizationEndpoint": "https://arauco.vssps.visualstudio.com/",
        "X-VSS-ResourceTenant": "79b9de4d-acfd-4ca2-b3ab-a2ce683ab7e1",
        "X-VSS-S2STargetService": "00000002-0000-8888-8000-000000000000/visualstudio.com",
        "Request-Context": "appId=cid-v1:e3d45cd2-3b08-46bc-b297-cda72fdc1dc1",
        "Access-Control-Expose-Headers": "Request-Context",
        "X-Content-Type-Options": "nosniff",
        "X-Cache": "CONFIG_NOCACHE",
        "X-MSEdge-Ref": "Ref A: EB2405083D9F45D5B4AD695C04A7B2C8 Ref B: BN3EDGE0408 Ref C: 2023-11-30T19:13:55Z",
        "Date": "Thu, 30 Nov 2023 19:13:54 GMT",
        "Content-Length": "647",
        "Content-Type": "text/html; charset=utf-8",
        "Expires": "-1"
    },
    "body": "<html><head><title>Object moved</title></head><body>\r\n<h2>Object moved to <a href=\"https://spsprodeus23.vssps.visualstudio.com/_signin?realm=dev.azure.com&amp;reply_to=https%3A%2F%2Fdev.azure.com%2FArauco%2FCL-OPER-LABS%2F_apis%2Fbuild%2Fdefinitions%3Fapi-version%3D6.1-preview.7&amp;redirect=1&amp;hid=3a7161d2-cf06-40a7-af6a-c483944d2e76&amp;context=eyJodCI6MiwiaGlkIjoiYmQ3MjZhMjItYTg4Mi00NmFkLWJiYmItMmRlMzBjYzE3ZjU0IiwicXMiOnt9LCJyciI6IiIsInZoIjoiIiwiY3YiOiIiLCJjcyI6IiJ90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2\">here</a>.</h2>\r\n</body></html>\r\n"
}
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-12-01T09:40:43.75+00:00

    @Anonymous Thanks for reaching out.

    As per the HTTP response I can see 302 status code and logic app doesn't handle the redirects automatically and only 200 and 202 response from the API will be successful. The status code are documented here.

    To handle any redirection you need to handle this exception and make another HTTP call with the redirect URL that would be return in the response from your API.

    Under the response header you should see the location as below. As Logic App understood that HTTP 302 response as an error you need to configure the Run After to handle both successful responses and error responses.

    User's image

    Let me know if you have any queries or concerns.

    Please 'Accept Answer' if it helped so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.