scheduled Virtual Machine Task (Logic App) for Start and Deallocate operation suddenly stops working

Muhammet Atalay 0 Reputation points
2025-06-23T23:49:01.8833333+00:00

I have got 2 automation tasks for windows 11 based virtual machine start or deallocation. however, they suddenly stop working on 26th of May by throwing

"

HTTP Error 400. The size of the request headers is too long

"

i did not do any changes for couple years.

is there any update on API connection or call ? how can i sort out the issue?

thanks

{
    "error": {
        "code": 400,
        "source": "logic-apis-eastus.azure-apim.net",
        "clientRequestId": "fed66846-137b-473f-a6ad-bf33b47500fd",
        "message": "The response is not in a JSON format.",
        "innerError": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Bad Request - Request Too Long</h2>\r\n<hr><p>HTTP Error 400. The size of the request headers is too long.</p>\r\n</BODY></HTML>\r\n"
    }
}
": {    "code": 400,    "source": "logic-apis-eastus.azure-apim.net",    "clientRequestId": "fed66846-137b-473f-a6ad-bf33b47500fd",    "message": "The response is not in a JSON format.",    "innerError": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Bad Request - Request Too Long</h2>\r\n<hr><p>HTTP Error 400. The size of the request headers is too long.</p>\r\n</BODY></HTML>\r\n"  }}

thanks...

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,044 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Muhammet ATALAY 0 Reputation points
    2025-06-24T13:10:59.86+00:00

    It is scheduled task so running back. i am not sure how cookies get a problem for backend service. i set Logic App through azure portal then scheduled it finally closed the browser :)


  2. Alex Burlachenko 10,565 Reputation points
    2025-06-24T13:29:22.8166667+00:00

    Muhammet hi there,

    thanks for bringing this up ))

    check if ur logic app got any sneaky updates around may 26th. microsoft does tweak things, and sometimes headers grow without us noticing. next, trim those headers! u might have accumulated too many cookies or auth tokens over time. try resetting the connection in ur logic app. go to 'api connections', find the one u use for vm ops, and hit 'edit'. then just reauthorize it. boom, fresh headers )) peek at the 'http action' in ur logic app. if u added any custom headers, they might be bloating the request. strip em down to the essentials. microsoft's got a guide on optimizing http calls logic apps http limits.

    that might help elsewhere too this 'header too long' jazz isn’t just an azure thing. if u work with apis in other tools, keep an eye on header size. some servers freak out if u go over 8kb ))

    worth looking into ur vm’s logs too. sometimes the issue starts there and cascades. azure’s got a killer log analytics tool, check it out azure monitor logs.

    and if u’re feeling fancy, u could split the logic app into smaller steps. fewer headers per call, less chance of chaos. just a thought ))

    hope this gets u back on track! let us know if the gremlins persist :)

    rgds,

    Alex

    0 comments No comments

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.