Can not create Network Security Groups inbound rules for my VM

Isaac 10 Reputation points
2025-08-16T04:46:05.2933333+00:00

I have only one NSG and no rules inside. So it's definitely impossible for my NSG to exceed the amount limit of NSG rules.

When I'm trying to create an inbound rule to open a port on my Virtual Machine, it tells me failed to create security rule. When I'm further checking in the activity logs under monitor, it shows the following:

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

I don't know what is going on. I tried to re-login, I tried to clear the cookie and cache, and even used another browser. I tried to use the developer tool to look at the header and it seems like the auth token is extremely large. I calculated the length of the encoded token and its 13582 characters. I don't know if this is related, but I don't think the Bearer token is something I can control. Can somebody help me on this?

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.
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 126K Reputation points MVP Volunteer Moderator
    2025-08-16T08:25:08.71+00:00

    Hi @Isaac ,

    the error message showed up in July 2025 when creating NSGs via Azure Portal already.

    Is there a new problem on updating NSG in Azure web portal? Been fine for years ..

    Clearing the browser cache sometimes helped. But you already tried different browsers.

    Maybe it's an option and workaround to create the NSG rule via AZ CLI?

    If so please take a look here: az network nsg rule


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


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.