An Azure service that is used to provision Windows and Linux virtual machines.
Hello Jeffrey,
Thank you for sharing the details. The “Request headers are too long” error during VM deployment is not related to the VM configuration itself. This is a client-side authentication/token issue that can occur in the Azure portal.
When deploying a VM through the Azure portal, the request includes an authentication token. If that token becomes too large (for example, due to:
- membership in a large number of Microsoft Entra ID (Azure AD) groups, or
- accumulated authentication claims/cookies),
the portal request can exceed the HTTP header size limit, causing the deployment to fail with:
HTTP 400 – Request headers are too long
This explains why the issue can persist even after clearing cookies or using an incognito window.
**Steps to perform:
Deploy using Azure CLI or ARM/Bicep**
- Deploying via Azure CLI, PowerShell, or ARM/Bicep templates avoids the portal’s browser-based token size limitation and is the most reliable workaround.
Azure CLI VM deployment example:
az vm create --resource-group <RG> --name <VMName> --image UbuntuLTS --admin-username azureuser
Reduce token size (if applicable)
- If your account is a member of many Entra ID groups, reducing unnecessary group memberships can shrink the token and prevent the error. Large group claims are a known cause of this behavior
Option 3 – Try a different user account
- Using an account with fewer Entra ID group memberships can also help isolate and resolve the issue.
This is a portal-side authentication header limitation, not a VM deployment fault.
Links:
https://stackoverflow.com/questions/46100272/azure-portal-bad-request-request-too-long
Thanks,
Manish Deshpande.