Skip to content

Commit adf46cd

Browse files
authored
Merge pull request #106649 from rohitnayakmsft/sqldbmar12changes
Sql Db Connectivity changes for Mar 12 deadline
2 parents dd3ad3c + 0dfa699 commit adf46cd

File tree

7 files changed

+227
-93
lines changed

7 files changed

+227
-93
lines changed

articles/firewall/sql-fqdn-filtering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Application rules with SQL FQDNs is currently available in all regions via the A
3232
## Configure using Azure CLI
3333

3434
1. Deploy an [Azure Firewall using Azure CLI](deploy-cli.md).
35-
2. If you filter traffic to Azure SQL Database, SQL Data Warehouse, or SQL Managed Instance, ensure the SQL connectivity mode is set to **Proxy**. To learn how to switch SQL connectivity mode, see [Azure SQL Connectivity Architecture](https://docs.microsoft.com/azure/sql-database/sql-database-connectivity-architecture#change-azure-sql-database-connection-policy).
35+
2. If you filter traffic to Azure SQL Database, SQL Data Warehouse, or SQL Managed Instance, ensure the SQL connectivity mode is set to **Proxy**. To learn how to switch SQL connectivity mode, see [Azure SQL Connectivity Settings](https://docs.microsoft.com/azure/sql-database/sql-database-connectivity-settingse#change-azure-sql-database-connection-policy).
3636

3737
> [!NOTE]
3838
> SQL *proxy* mode can result in more latency compared to *redirect*. If you want to continue using redirect mode, which is the default for clients connecting within Azure, you can filter access using the SQL [service tag](service-tags.md) in firewall [network rules](tutorial-firewall-deploy-portal.md#configure-a-network-rule).
@@ -54,7 +54,7 @@ Application rules with SQL FQDNs is currently available in all regions via the A
5454

5555
## Configure using the Azure portal
5656
1. Deploy an [Azure Firewall using Azure CLI](deploy-cli.md).
57-
2. If you filter traffic to Azure SQL Database, SQL Data Warehouse, or SQL Managed Instance, ensure the SQL connectivity mode is set to **Proxy**. To learn how to switch SQL connectivity mode, see [Azure SQL Connectivity Architecture](../sql-database/sql-database-connectivity-architecture.md#change-azure-sql-database-connection-policy).
57+
2. If you filter traffic to Azure SQL Database, SQL Data Warehouse, or SQL Managed Instance, ensure the SQL connectivity mode is set to **Proxy**. To learn how to switch SQL connectivity mode, see [Azure SQL Connectivity Settings](https://docs.microsoft.com/azure/sql-database/sql-database-connectivity-settingse#change-azure-sql-database-connection-policy).
5858

5959
> [!NOTE]
6060
> SQL *proxy* mode can result in more latency compared to *redirect*. If you want to continue using redirect mode, which is the default for clients connecting within Azure, you can filter access using the SQL [service tag](service-tags.md) in firewall [network rules](tutorial-firewall-deploy-portal.md#configure-a-network-rule).
315 KB
Loading

articles/sql-database/sql-database-connectivity-architecture.md

Lines changed: 14 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ ms.topic: conceptual
1111
author: rohitnayakmsft
1212
ms.author: rohitna
1313
ms.reviewer: carlrab, vanto
14-
ms.date: 07/02/2019
14+
ms.date: 03/09/2020
1515
---
1616
# Azure SQL Connectivity Architecture
17+
> [!NOTE]
18+
> This article applies to Azure SQL server, and to both SQL Database and SQL Data Warehouse databases that are created on the Azure SQL server. For simplicity, SQL Database is used when referring to both SQL Database and SQL Data Warehouse.
1719
18-
This article explains the Azure SQL Database and SQL Data Warehouse connectivity architecture as well as how the different components function to direct traffic to your instance of Azure SQL. These connectivity components function to direct network traffic to the Azure SQL Database or SQL Data Warehouse with clients connecting from within Azure and with clients connecting from outside of Azure. This article also provides script samples to change how connectivity occurs, and the considerations related to changing the default connectivity settings.
20+
> [!IMPORTANT]
21+
> This article does *not* apply to **Azure SQL Database Managed Instance**. Refer to [Connectivity architecture for a managed instance](sql-database-managed-instance-connectivity-architecture.md).
22+
23+
This article explains architecture of various components that direct network traffic to the Azure SQL Database or SQL Data Warehouse. It also explains different connection policies and how it impacts clients connecting from within Azure and clients connecting from outside of Azure.
1924

2025
## Connectivity architecture
2126

@@ -33,13 +38,13 @@ The following steps describe how a connection is established to an Azure SQL dat
3338

3439
Azure SQL Database supports the following three options for the connection policy setting of a SQL Database server:
3540

36-
- **Redirect (recommended):** Clients establish connections directly to the node hosting the database, leading to reduced latency and improved throughput. For connections to use this mode clients need to
37-
- Allow inbound and outbound communication from the client to all Azure IP addresses in the region on ports in the range of 11000 11999.
38-
- Allow inbound and outbound communication from the client to Azure SQL Database gateway IP addresses on port 1433.
41+
- **Redirect (recommended):** Clients establish connections directly to the node hosting the database, leading to reduced latency and improved throughput. For connections to use this mode, clients need to:
42+
- Allow outbound communication from the client to all Azure IP addresses in the region on ports in the range of 11000 11999. Use the Service Tags for SQL to make this easier to manage.
43+
- Allow outbound communication from the client to Azure SQL Database gateway IP addresses on port 1433.
3944

40-
- **Proxy:** In this mode, all connections are proxied via the Azure SQL Database gateways,leading to increased latency and reduced throughput. For connections to use this mode clients need to allow inbound and outbound communication from the client to Azure SQL Database gateway IP addresses on port 1433.
45+
- **Proxy:** In this mode, all connections are proxied via the Azure SQL Database gateways,leading to increased latency and reduced throughput. For connections to use this mode, clients need to allow outbound communication from the client to Azure SQL Database gateway IP addresses on port 1433.
4146

42-
- **Default:** This is the connection policy in effect on all servers after creation unless you explicitly alter the connection policy to either `Proxy` or `Redirect`. The default policy is`Redirect` for all client connections originating inside of Azure (e.g. from an Azure Virtual Machine) and `Proxy`for all client connections originating outside (e.g. connections from your local workstation).
47+
- **Default:** This is the connection policy in effect on all servers after creation unless you explicitly alter the connection policy to either `Proxy` or `Redirect`. The default policy is`Redirect` for all client connections originating inside of Azure (for example, from an Azure Virtual Machine) and `Proxy`for all client connections originating outside (for example, connections from your local workstation).
4348

4449
We highly recommend the `Redirect` connection policy over the `Proxy` connection policy for the lowest latency and highest throughput.However, you will need to meet the additional requirements for allowing network traffic as outlined above. If the client is an Azure Virtual Machine you can accomplish this using Network Security Groups (NSG) with [service tags](../virtual-network/security-overview.md#service-tags). If the client is connecting from a workstation on-premises then you may need to work with your network admin to allow network traffic through your corporate firewall.
4550

@@ -95,6 +100,8 @@ Details of how traffic shall be migrated to new Gateways in specific regions are
95100
| Korea South | 52.231.200.86 |
96101
| North Central US | 23.96.178.199, 23.98.55.75, 52.162.104.33 |
97102
| North Europe | 40.113.93.91, 191.235.193.75, 52.138.224.1 |
103+
| Norway East | 51.120.96.0 |
104+
| Norway West | 51.120.216.0 |
98105
| South Africa North | 102.133.152.0 |
99106
| South Africa West | 102.133.24.0 |
100107
| South Central US | 13.66.62.124, 23.98.162.75, 104.214.16.32 |
@@ -109,78 +116,7 @@ Details of how traffic shall be migrated to new Gateways in specific regions are
109116
| West US 2 | 13.66.226.202 |
110117
| | |
111118

112-
## Change Azure SQL Database connection policy
113-
114-
To change the Azure SQL Database connection policy for an Azure SQL Database server, use the [conn-policy](https://docs.microsoft.com/cli/azure/sql/server/conn-policy) command.
115-
116-
- If your connection policy is set to `Proxy`, all network packets flow via the Azure SQL Database gateway. For this setting, you need to allow outbound to only the Azure SQL Database gateway IP. Using a setting of `Proxy` has more latency than a setting of `Redirect`.
117-
- If your connection policy is setting `Redirect`, all network packets flow directly to the database cluster. For this setting, you need to allow outbound to multiple IPs.
118-
119-
## Script to change connection settings via PowerShell
120-
121-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
122-
> [!IMPORTANT]
123-
> The PowerShell Azure Resource Manager module is still supported by Azure SQL Database, but all future development is for the Az.Sql module. For these cmdlets, see [AzureRM.Sql](https://docs.microsoft.com/powershell/module/AzureRM.Sql/). The arguments for the commands in the Az module and in the AzureRm modules are substantially identical. The following script requires the [Azure PowerShell module](/powershell/azure/install-az-ps).
124-
125-
The following PowerShell script shows how to change the connection policy.
126-
127-
```powershell
128-
# Get SQL Server ID
129-
$sqlserverid=(Get-AzSqlServer -ServerName sql-server-name -ResourceGroupName sql-server-group).ResourceId
130-
131-
# Set URI
132-
$id="$sqlserverid/connectionPolicies/Default"
133-
134-
# Get current connection policy
135-
(Get-AzResource -ResourceId $id).Properties.connectionType
136-
137-
# Update connection policy
138-
Set-AzResource -ResourceId $id -Properties @{"connectionType" = "Proxy"} -f
139-
```
140-
141-
## Script to change connection settings via Azure CLI
142-
143-
> [!IMPORTANT]
144-
> This script requires the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli).
145-
146-
### Azure CLI in a bash shell
147-
148-
> [!IMPORTANT]
149-
> This script requires the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli).
150-
151-
The following CLI script shows how to change the connection policy in a bash shell.
152-
153-
```azurecli-interactive
154-
# Get SQL Server ID
155-
sqlserverid=$(az sql server show -n sql-server-name -g sql-server-group --query 'id' -o tsv)
156-
157-
# Set URI
158-
ids="$sqlserverid/connectionPolicies/Default"
159-
160-
# Get current connection policy
161-
az resource show --ids $ids
162-
163-
# Update connection policy
164-
az resource update --ids $ids --set properties.connectionType=Proxy
165-
```
166-
167-
### Azure CLI from a Windows command prompt
168-
169-
> [!IMPORTANT]
170-
> This script requires the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli).
171-
172-
The following CLI script shows how to change the connection policy from a Windows command prompt (with Azure CLI installed).
173-
174-
```azurecli
175-
# Get SQL Server ID and set URI
176-
FOR /F "tokens=*" %g IN ('az sql server show --resource-group myResourceGroup-571418053 --name server-538465606 --query "id" -o tsv') do (SET sqlserverid=%g/connectionPolicies/Default)
177-
178-
# Get current connection policy
179-
az resource show --ids %sqlserverid%
180119

181-
# Update connection policy
182-
az resource update --ids %sqlserverid% --set properties.connectionType=Proxy
183-
```
184120

185121
## Next steps
186122

0 commit comments

Comments
 (0)