Skip to content

Commit 80898b2

Browse files
authored
Merge pull request #99145 from rohitnayakmsft/jediconnbranch1
Allow Azure Services section updates
2 parents fe742a8 + e67c2e8 commit 80898b2

File tree

1 file changed

+44
-16
lines changed

1 file changed

+44
-16
lines changed

articles/sql-database/sql-database-networkaccess-overview.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,53 @@ You can also change this setting via the firewall pane after the Azure SQL Serve
4343

4444
When set to **ON** Azure SQL Server allows communications from all resources inside the Azure boundary, that may or may not be part of your subscription.
4545

46-
In many cases, the **ON** setting is more permissive than what most customers want.They may want to set this setting to **OFF** and replace it with more restrictive IP firewall rules or Virtual Network firewall rules. Doing so affects the following features:
46+
In many cases, the **ON** setting is more permissive than what most customers want.They may want to set this setting to **OFF** and replace it with more restrictive IP firewall rules or Virtual Network firewall rules. Doing so affects the following features that run on VMs in Azure that not part of your VNet and hence connect to Sql Database via an Azure IP address.
4747

4848
### Import Export Service
49+
Import Export Service does not work **Allow Azure services to access server** set to OFF. However you can work around the problem [by manually running sqlpackage.exe from an Azure VM or performing the export](https://docs.microsoft.com/azure/sql-database/import-export-from-vm) directly in your code by using the DACFx API.
50+
51+
### Data Sync
52+
To use the Data sync feature with **Allow Azure services to access server** set to OFF, you need to create individual firewall rule entries to [add IP addresses](sql-database-server-level-firewall-rule.md) from the **Sql service tag** for the region hosting the **Hub** database.
53+
Add these server level firewall rules to the logical servers hosting both **Hub** and **Member** databases ( which may be in different regions)
54+
55+
Use the following PowerShell script to generate the IP addresses corresponding to Sql service tag for West US region
56+
```powershell
57+
PS C:\> $serviceTags = Get-AzNetworkServiceTag -Location eastus2
58+
PS C:\> $sql = $serviceTags.Values | Where-Object { $_.Name -eq "Sql.WestUS" }
59+
PS C:\> $sql.Properties.AddressPrefixes.Count
60+
70
61+
PS C:\> $sql.Properties.AddressPrefixes
62+
13.86.216.0/25
63+
13.86.216.128/26
64+
13.86.216.192/27
65+
13.86.217.0/25
66+
13.86.217.128/26
67+
13.86.217.192/27
68+
```
69+
70+
> [!TIP]
71+
> Get-AzNetworkServiceTag returns the global range for Sql Service Tag despite specifying the Location parameter. Be sure to filter it to the region that hosts the Hub database used by your sync group
72+
73+
Note that the output of the PowerShell script is in Classless Inter-Domain Routing (CIDR) notation and this needs to be converted to a format of Start and End IP address using [Get-IPrangeStartEnd.ps1](https://gallery.technet.microsoft.com/scriptcenter/Start-and-End-IP-addresses-bcccc3a9) like this
74+
```powershell
75+
PS C:\> Get-IPrangeStartEnd -ip 52.229.17.93 -cidr 26
76+
start end
77+
----- ---
78+
52.229.17.64 52.229.17.127
79+
```
80+
81+
Do the following additional steps to convert all the IP addresses from CIDR to Start and End IP address format.
82+
83+
```powershell
84+
PS C:\>foreach( $i in $sql.Properties.AddressPrefixes) {$ip,$cidr= $i.split('/') ; Get-IPrangeStartEnd -ip $ip -cidr $cidr;}
85+
start end
86+
----- ---
87+
13.86.216.0 13.86.216.127
88+
13.86.216.128 13.86.216.191
89+
13.86.216.192 13.86.216.223
90+
```
91+
You can now add these as distinct firewall rules and then set **Allow Azure services to access server** to OFF.
4992

50-
Azure SQL Database Import Export Service runs on VMs in Azure. These VMs are not in your VNet and hence get an Azure IP when connecting to your
51-
database. On removing **Allow Azure services to access server** these VMs will not be able to access your databases.
52-
You can work around the problem by running the BACPAC import or export directly in your code by using the DACFx API.
53-
54-
### SQL Database Query Editor
55-
56-
The Azure SQL Database Query Editor is deployed on VMs in Azure. These VMs are not in your VNet. Therefore the VMs get an Azure IP when connecting to your database. On removing **Allow Azure services to access server**, these VMs will not be able to access your databases.
57-
58-
### Table Auditing
59-
60-
At present, there are two ways to enable auditing on your SQL Database. Table auditing fails after you have enabled service endpoints on your Azure SQL Server. Mitigation here is to move to Blob auditing.
61-
62-
### Impact on Data Sync
63-
64-
Azure SQL Database has the Data Sync feature that connects to your databases using Azure IPs. When using service endpoints, you will turn off **Allow Azure services to access server** access to your SQL Database server and will break the Data Sync feature.
6593

6694
## IP firewall rules
6795
Ip based firewall is a feature of Azure SQL Server that prevents all access to your database server until you explicitly [add IP addresses](sql-database-server-level-firewall-rule.md) of the client machines.

0 commit comments

Comments
 (0)