You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-configure-firewall.md
+35-45Lines changed: 35 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how to configure IP access control policies for firewall supp
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
7
-
ms.date: 07/25/2019
7
+
ms.date: 09/28/2019
8
8
ms.author: mjbrown
9
9
---
10
10
@@ -18,7 +18,7 @@ You can secure the data stored in your Azure Cosmos DB account by using IP firew
18
18
19
19
## <aid="configure-ip-policy"></a> Configure an IP firewall by using the Azure portal
20
20
21
-
To set the IP access control policy in the Azure portal, go to the Azure Cosmos DB account page and select **Firewall and virtual networks** on the navigation menu. Change the **Allow access from** value to **Selected networks**, and then select **Save**.
21
+
To set the IP access control policy in the Azure portal, go to the Azure Cosmos DB account page and select **Firewall and virtual networks** on the navigation menu. Change the **Allow access from** value to **Selected networks**, and then select **Save**.
22
22
23
23

24
24
@@ -38,7 +38,7 @@ When you enable an IP access control policy programmatically, you need to add th
38
38
|US Gov|52.244.48.71|
39
39
|All other regions|104.42.195.92,40.76.54.131,52.176.6.30,52.169.50.45,52.187.184.26|
40
40
41
-
You can enable access to the Azure portal by selecting the **Allow access from Azure portal** option, as shown in the following screenshot:
41
+
You can enable access to the Azure portal by selecting the **Allow access from Azure portal** option, as shown in the following screenshot:
42
42
43
43

44
44
@@ -49,23 +49,23 @@ If you access your Azure Cosmos DB account from services that don’t provide a
49
49
> [!NOTE]
50
50
> This option configures the firewall to allow all requests from Azure, including requests from the subscriptions of other customers deployed in Azure. The list of IPs allowed by this option is wide, so it limits the effectiveness of a firewall policy. Use this option only if your requests don’t originate from static IPs or subnets in virtual networks. Choosing this option automatically allows access from the Azure portal because the Azure portal is deployed in Azure.
51
51
52
-
You can enable access to the Azure portal by selecting the **Accept connections from within public Azure datacenters** option, as shown in the following screenshot:
52
+
You can enable access to the Azure portal by selecting the **Accept connections from within Azure datacenters** option, as shown in the following screenshot:
53
53
54
54

55
55
56
56
### Requests from your current IP
57
57
58
-
To simplify development, the Azure portal helps you identify and add the IP of your client machine to the allowed list. Apps running your machine can then access your Azure Cosmos DB account.
58
+
To simplify development, the Azure portal helps you identify and add the IP of your client machine to the allowed list. Apps running your machine can then access your Azure Cosmos DB account.
59
59
60
-
The portal automatically detects the client IP address. It might be the client IP address of your machine, or the IP address of your network gateway. Make sure to remove this IP address before you take your workloads to production.
60
+
The portal automatically detects the client IP address. It might be the client IP address of your machine, or the IP address of your network gateway. Make sure to remove this IP address before you take your workloads to production.
61
61
62
62
To add your current IP to the list of IPs, select **Add my current IP**. Then select **Save**.
63
63
64
64

65
65
66
66
### Requests from cloud services
67
67
68
-
In Azure, cloud services are a common way for hosting middle-tier service logic by using Azure Cosmos DB. To enable access to your Azure Cosmos DB account from a cloud service, you must add the public IP address of the cloud service to the allowed list of IP addresses associated with your Azure Cosmos DB account by [configuring the IP access control policy](#configure-ip-policy). This ensures that all role instances of cloud services have access to your Azure Cosmos DB account.
68
+
In Azure, cloud services are a common way for hosting middle-tier service logic by using Azure Cosmos DB. To enable access to your Azure Cosmos DB account from a cloud service, you must add the public IP address of the cloud service to the allowed list of IP addresses associated with your Azure Cosmos DB account by [configuring the IP access control policy](#configure-ip-policy). This ensures that all role instances of cloud services have access to your Azure Cosmos DB account.
69
69
70
70
You can retrieve IP addresses for your cloud services in the Azure portal, as shown in the following screenshot:
71
71
@@ -75,7 +75,7 @@ When you scale out your cloud service by adding role instances, those new instan
75
75
76
76
### Requests from virtual machines
77
77
78
-
You can also use [virtual machines](https://azure.microsoft.com/services/virtual-machines/) or [virtual machine scale sets](../virtual-machine-scale-sets/virtual-machine-scale-sets-overview.md) to host middle-tier services by using Azure Cosmos DB. To configure your Cosmos DB account such that it allows access from virtual machines, you must configure the public IP address of the virtual machine and/or virtual machine scale set as one of the allowed IP addresses for your Azure Cosmos DB account by [configuring the IP access control policy](#configure-ip-policy).
78
+
You can also use [virtual machines](https://azure.microsoft.com/services/virtual-machines/) or [virtual machine scale sets](../virtual-machine-scale-sets/virtual-machine-scale-sets-overview.md) to host middle-tier services by using Azure Cosmos DB. To configure your Cosmos DB account such that it allows access from virtual machines, you must configure the public IP address of the virtual machine and/or virtual machine scale set as one of the allowed IP addresses for your Azure Cosmos DB account by [configuring the IP access control policy](#configure-ip-policy).
79
79
80
80
You can retrieve IP addresses for virtual machines in the Azure portal, as shown in the following screenshot:
81
81
@@ -89,7 +89,7 @@ When you access your Azure Cosmos DB account from a computer on the internet, th
89
89
90
90
## <aid="configure-ip-firewall-arm"></a>Configure an IP firewall by using a Resource Manager template
91
91
92
-
To configure access control to your Azure Cosmos DB account, make sure that the Resource Manager template specifies the **ipRangeFilter** attribute with a list of allowed IP ranges. If configuring IP Firewall to an already deployed Cosmos account, ensure the `locations` array matches what is currently deployed. You cannot simultaneously modify the `locations` array and other properties. For more information and samples of ARM Templates for Azure Cosmos DB see, [Azure Resource Manager templates for Azure Cosmos DB](resource-manager-samples.md)
92
+
To configure access control to your Azure Cosmos DB account, make sure that the Resource Manager template specifies the **ipRangeFilter** attribute with a list of allowed IP ranges. If configuring IP Firewall to an already deployed Cosmos account, ensure the `locations` array matches what is currently deployed. You cannot simultaneously modify the `locations` array and other properties. For more information and samples of Azure Resource Manager templates for Azure Cosmos DB see, [Azure Resource Manager templates for Azure Cosmos DB](resource-manager-samples.md)
93
93
94
94
```json
95
95
{
@@ -111,83 +111,73 @@ To configure access control to your Azure Cosmos DB account, make sure that the
111
111
112
112
## <aid="configure-ip-firewall-cli"></a>Configure an IP access control policy by using the Azure CLI
113
113
114
-
The following command shows how to create an Azure Cosmos DB account with IP access control:
114
+
The following command shows how to create an Azure Cosmos DB account with IP access control:
115
115
116
116
```azurecli-interactive
117
+
# Create a Cosmos DB account with default values and IP Firewall enabled
## <aid="troubleshoot-ip-firewall"></a>Troubleshoot issues with an IP access control policy
171
159
172
-
You can troubleshoot issues with an IP access control policy by using the following options:
160
+
You can troubleshoot issues with an IP access control policy by using the following options:
161
+
162
+
### Azure portal
173
163
174
-
### Azure portal
175
164
By enabling an IP access control policy for your Azure Cosmos DB account, you block all requests to your account from machines outside the allowed list of IP address ranges. To enable portal data-plane operations like browsing containers and querying documents, you need to explicitly allow Azure portal access by using the **Firewall** pane in the portal.
176
165
177
-
### SDKs
178
-
When you access Azure Cosmos DB resources by using SDKs from machines that are not in the allowed list, a generic **403 Forbidden** response is returned with no additional details. Verify the allowed IP list for your account, and make sure that the correct policy configuration is applied to your Azure Cosmos DB account.
166
+
### SDKs
167
+
168
+
When you access Azure Cosmos DB resources by using SDKs from machines that are not in the allowed list, a generic **403 Forbidden** response is returned with no additional details. Verify the allowed IP list for your account, and make sure that the correct policy configuration is applied to your Azure Cosmos DB account.
179
169
180
170
### Source IPs in blocked requests
171
+
181
172
Enable diagnostic logging on your Azure Cosmos DB account. These logs show each request and response. The firewall-related messages are logged with a 403 return code. By filtering these messages, you can see the source IPs for the blocked requests. See [Azure Cosmos DB diagnostic logging](logging.md).
182
173
183
174
### Requests from a subnet with a service endpoint for Azure Cosmos DB enabled
184
-
Requests from a subnet in a virtual network that has a service endpoint for Azure Cosmos DB enabled sends the virtual network and subnet identity to Azure Cosmos DB accounts. These requests don't have the public IP of the source, so IP filters reject them. To allow access from specific subnets in virtual networks, add an access control list as outlined in [How to configure virtual network and subnet-based access for your Azure Cosmos DB account](how-to-configure-vnet-service-endpoint.md). It can take up to 15 minutes for firewall rules to apply.
185
175
176
+
Requests from a subnet in a virtual network that has a service endpoint for Azure Cosmos DB enabled sends the virtual network and subnet identity to Azure Cosmos DB accounts. These requests don't have the public IP of the source, so IP filters reject them. To allow access from specific subnets in virtual networks, add an access control list as outlined in [How to configure virtual network and subnet-based access for your Azure Cosmos DB account](how-to-configure-vnet-service-endpoint.md). It can take up to 15 minutes for firewall rules to apply.
186
177
187
178
## Next steps
188
179
189
180
To configure a virtual network service endpoint for your Azure Cosmos DB account, see the following articles:
190
181
191
182
*[Virtual network and subnet access control for your Azure Cosmos DB account](vnet-service-endpoint.md)
192
183
*[Configure virtual network and subnet-based access for your Azure Cosmos DB account](how-to-configure-vnet-service-endpoint.md)
0 commit comments