Cannot Save changes to a Network Security Group

Keith Boatner 40 Reputation points
2025-09-03T13:53:13.79+00:00

When saving a new IP Address to our RDP Network Security Group we are receiving an error "Failed to Update Security Rule". The Activity Log says that the headers are too long.

] <h2>Bad Request - Request Too Long</h2> <hr><p>HTTP Error 400. The size of the request headers is too long.</p>

Azure Virtual Network
Azure Virtual Network

An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.


2 answers

Sort by: Most helpful
  1. TP 164.7K Reputation points Volunteer Moderator
    2025-09-03T18:20:35.8033333+00:00

    Hi Keith,

    Go ahead and first try Incognito/InPrivate window or clearing cookies and if that doesn't solve it you will need to follow my instructions below so that the token isn't so large.

    Please navigate to Microsoft Entra ID in Azure portal, create a new user with Global Administrator role assigned to it, next navigate to your Subscription -- Access control (IAM) blade, add role assignment for this new user for Owner role.

    Once the above is complete, please open Guest browser session (in Chrome, click little person icon in upper right corner -- Open Guest profile), sign in using this new user, then try to create new NSG rule.

    Please reply back here with your results, whether positive or negative.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    Was this answer helpful?


  2. Ravi Varma Mudduluru 12,625 Reputation points Microsoft External Staff Moderator
    2025-09-03T15:56:45.15+00:00

    Hello @Keith Boatner,

    Hope you're doing well!

    Thanks for reaching out to Microsoft Q&A. 

    It understand that you’re running into a “Bad Request – Request Too Long” error when updating your Network Security Group (NSG) in the Azure portal. This usually happens when the request header size becomes too large, often due to having too many or oversized rules.

    Here are some steps you can try

    1)Clear your browser cookies – this often resolves the issue, though it can be inconvenient.

    2If there are too many NSG rules, consider consolidating or removing unused ones. Azure has limits on request size, so trimming the rules may help.

    Reference https://stackoverflow.com/questions/46100272/azure-portal-bad-request-request-too-long?utm

    As an alternative, try using the Azure PowerShell /Azure CLI to create or update your NSG rules. This can sometimes bypass issues faced in the portal. You can list the rules with the following command:

    $NSGParams = @{
        Name              = "myNSG"
        ResourceGroupName = "myResourceGroup"
        Location          = "eastus"
    }
    New-AzNetworkSecurityGroup @NSGParams
      
    

    Ensure that Network Watcher is enabled in your region, it can help diagnose connectivity problems and provide more detailed insights.

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "Accept Answer" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    0 comments No comments

Your answer

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