Registered Servers in SSMS not popping up new firewall rule

Chris Sparks 21 Reputation points
2022-07-05T17:43:02.757+00:00

Have a specific user that has his public IP address change almost daily, and instead of going in and manually updating his current IP in the firewall (Which is what i currently do) we have made a custom role for him in azure to allow him to write to the firewall with his new IP when he needs it. Unfortunately, he uses Registered Servers and we've seen that using will not pop up the box to have him write his new IP to the firewall. Is this possible? Or is that just not available using the Registered Servers option?

Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
655 questions
0 comments No comments
{count} votes

Accepted answer
  1. msrini-MSFT 9,281 Reputation points Microsoft Employee
    2022-07-06T05:29:28.543+00:00

    Hi,

    Currently, your ask is not possible. You can raise a feature request in feedback.azure.com.

    A workaround would be having a PowerShell script which does the following:

    1. When you launch the script, it gets your current public IPv4 by accessing an open source API like what's my IP.
    2. Capture that IP and add a firewall rule to the SQL

    Here is the PowerShell snippet:

    Get-NetIPAddress | Select-Object IPAddress.  
    $myIP = Invoke-WebRequest -uri "https://api.ipify.org/"  
    $mycurrentIpv4=$myIP.Content  
      
      
      
    New-AzSqlServerFirewallRule -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -FirewallRuleName "Rule01" -StartIpAddress $mycurrentIpv4 -EndIpAddress $mycurrentIpv4  
      
    

    It can be implemented easily and the user just need to execute this script before accessing the SSMS.

    Regards,
    Karthik Srinivas

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.