Why is my connection to a SQL Server getting blocked even though my public IP is in the allow list?

Erich Late 0 Reputation points
2025-12-01T23:03:14.93+00:00

I have a SQL Server that is blocking connection from a specific office. I have already added the office public IP to the allow list. When trying to connect I get an error that says the public IP is not allowed and has been blocked. I have already removed the allow list entry and re-added it. The error code is NativeError=40615. I have other offices that are in the allow list that are not having this issue.

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Shruti Dhruv 405 Reputation points Microsoft External Staff Moderator
    2025-12-02T12:48:52.47+00:00

    Hi Eric,

    You can try these troubleshooting steps-

    1. Go to [Azure Portal → SQL Server → Firewall settings] and check the "Client IP" shown when you open the firewall settings page. This is the IP Azure sees for your connection attempt then compare it with the IP you added. If they differ, your office might be using NAT or Proxy that changes the outbound IP
    2. Azure SQL firewall does not support IPv6. If your network uses IPv6, ensure the client is connecting over IPv4.

    Hope this helps!
    Thank You for using Microsoft Q&A Forum

    0 comments No comments

  2. Pilladi Padma Sai Manisha 500 Reputation points Microsoft External Staff Moderator
    2025-12-02T23:24:36.3366667+00:00

    Hi Erich Late,
    Thank you for reaching out to Microsoft QA!
    it sounds like you're facing a frustrating situation with your SQL Server connection getting blocked despite your office's public IP being in the allow list. The error code you're seeing (NativeError=40615) indicates that the connection attempt is being rejected because your IP address is not allowed. Let's go through some potential reasons and solutions.

    Public Network Access Check:

    Confirm Public network access is "Selected networks" (not Disabled) in SQL Server > Networking. Disabled forces private endpoints only.​

    Rule Propagation Wait Time:

    Firewall updates take up to 5 mins. Wait full window after changes.​

    Catch the Real Client IP:

    Portal's client IP often wrong due to proxies from office PC, check whatismyipaddress.com for actual IPv4. Add as /32 rule.​

    Layered Firewall Rules Check server + database level:

    SELECT * FROM sys.database_firewall_rules;
    

    Remove conflicts, recreate at server level.​

    Auth Cache Flush Elastic pool? Run DBCC FLUSHAUTHCACHE; from another DB on server.​

    Next: Test mobile hotspot, grab blocked IP from logs, share Networking screenshot + whatismyip. What's your Public Network Access set to now?​

    If you've already confirmed these settings and the issue persists, could you provide more details on the following?

    • Is your SQL Server using a Private Endpoint or Public Endpoint for connection?
    • Are there any other network configurations like VPNs or proxies used in your office that might affect connectivity?
    • Could you check if there are any network constraints (e.g., inbound or outbound rules) set in your office's firewall or router?

    Let me know how it goes! Hope this helps!

    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.