Azure-SQLServer-SQL-Server-Public-Access

Azure Console:

  1. Go to SQL servers

  2. For each SQL server

  3. Click on Firewall and Virtual Networks

  4. Set Allow Azure services and resources to access this server to `OFF'

  5. Set firewall rules to limit access to only authorized connections

 

Azure PowerShell:

To disable Default Firewall Rule Allow access to Azure services :

Remove-AzureRmSqlServerFirewallRule -FirewallRuleName "AllowAllWindowsAzureIps" -ResourceGroupName -ServerName

To remove custom Firewall rule:
Remove-AzureRmSqlServerFirewallRule -FirewallRuleName -ResourceGroupName -ServerName

To set the appropriate firewall rule:
Set-AzureRmSqlServerFirewallRule -ResourceGroupName -ServerName -FirewallRuleName -StartIpAddress -EndIpAddress

Note: Disabling Allow access to Azure Services will break all connections to SQL server and Hosted Databases unless custom IP specific rules are not added in Firewall Policy.

Blue Hexagon Proprietary