Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

SSMS 17.1 Add New Firewall Rule Error Code 401: Add IP when logging into Azure DB for the first time.

The title says it all.
New SSMS install on new PC, to new DB on new Azure SQL Server.� Prompted to Log in to Azure, OK.
'New Firewall Rule' dialog Prompts to add firewall rule to Azure, OK. Click OK and get error
"An error occurred while creating a new firewall rults (HTTP Status Code 401)) (ConnectionDlg)"

6 votes
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)

We’ll send you updates on this idea

AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Sorry folks, but we are not able to repro this issue (either using SSMS 17.9.1 or SSMS 18 Preview 7).

Since multiple people out there are reporting this issue, it is obvious that we are missing something that is specific to your environment or configuration.

Could you help us out and try to describe a little better your subscription/environment/account/permissions?

For example, does the following mainstream scenario works for you all:
1) Connect to Azure Portal
2) Create SQL server+database
3) Go to SSMS and connect to
4) Add firewall rule

If it does, then can you identify what is different between the case where it works and the case where it does not?

Thanks,
-Matteo

10 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...
  • OzBobWa commented  ·   ·  Flag as inappropriate

    you'll need two azure subscriptions
    one that is your default one in azure portal
    2nd one that contains the SQL server and DB

  • Jay Hayman commented  ·   ·  Flag as inappropriate

    Just 1+ this as I'm having the same issue with 17.9.1 and the previous release. This used to work and certainly worked first time I used it but since that initial action, it;s never worked again. Manually adding my IP to the firewall via the Portal works fine,

  • kanadaj commented  ·   ·  Flag as inappropriate

    @Matteo the portal works just fine, as does SSMS on another machine. Reinstalling Windows and SSMS fixes the issue as well. So this is computer specific. Possibly a corruption of some cached info, although clearing IE cache didn't help. Maybe you're storing an expired token of some kind?

  • OzBobWa commented  ·   ·  Flag as inappropriate

    There is an issue with the error message not detailing the error returned from Azure.

    One possible error is that the Microsoft Account signed in on SSMS does not have permission to add a new IP to the firewall exception list.

    Try signing in as the owner of the subscription

Feedback and Knowledge Base