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/certificate-based-authentication.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ In this step, you will register a sample web application in your Azure AD accoun
34
34
35
35
***Name** – Provide a name for your application, it can be any name such as "sampleApp".
36
36
***Supported account types** – Choose **Accounts in this organizational directory only (Default Directory)** to allow resources in your current directory to access this application.
37
-
***Redirect URL** – Choose application of type **Web** and provide a URL where your application is hosted, it can be any URL. For this example, you can provide a test URL such as `https://sampleApp.com` it’s okay even if the app doesn’t exist.
37
+
***Redirect URL** – Choose application of type **Web** and provide a URL where your application is hosted, it can be any URL. For this example, you can provide a test URL such as `https://sampleApp.com` it's okay even if the app doesn't exist.
38
38
39
39

40
40
@@ -48,7 +48,7 @@ In this step, you will register a sample web application in your Azure AD accoun
48
48
49
49
In this step, you will install the Azure AD PowerShell module. This module is required to get the ID of the application you registered in the previous step and associate a self-signed certificate to that application.
50
50
51
-
1. Open Windows PowerShell ISE with administrator rights. If you haven’t already done, install the AZ PowerShell module and connect to your subscription. If you have multiple subscriptions, you can set the context of current subscription as shown in the following commands:
51
+
1. Open Windows PowerShell ISE with administrator rights. If you haven't already done, install the AZ PowerShell module and connect to your subscription. If you have multiple subscriptions, you can set the context of current subscription as shown in the following commands:
52
52
53
53
```powershell
54
54
Install-Module -Name Az -AllowClobber
@@ -133,18 +133,20 @@ In this step, you will sign into Azure by using the application and the certific
The previous command will display the primary and secondary master keys of your Azure Cosmos account. You can view the Activity log of your Azure Cosmos account to validate that the get keys request succeeded and the event is initiated by the "sampleApp" application.
145
-
146
-

147
+
The previous command will display the primary and secondary master keys of your Azure Cosmos account. You can view the Activity log of your Azure Cosmos account to validate that the get keys request succeeded and the event is initiated by the "sampleApp" application.
147
148
149
+

@@ -4,7 +4,7 @@ description: This document describes the steps required to set up a virtual netw
4
4
author: markjbrown
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
7
-
ms.date: 09/28/2019
7
+
ms.date: 03/26/2020
8
8
ms.author: mjbrown
9
9
10
10
---
@@ -36,7 +36,7 @@ The following sections describe how to configure a virtual network service endpo
36
36
37
37
1. To grant access to an existing virtual network's subnet, under **Virtual networks**, select **Add existing Azure virtual network**.
38
38
39
-
1. Select the **Subscription** from which you want to add an Azure virtual network. Select the Azure **Virtual networks** and **Subnets** that you want to provide access to your Azure Cosmos DB account. Next, select **Enable** to enable selected networks with service endpoints for "Microsoft.AzureCosmosDB". When it’s complete, select **Add**.
39
+
1. Select the **Subscription** from which you want to add an Azure virtual network. Select the Azure **Virtual networks** and **Subnets** that you want to provide access to your Azure Cosmos DB account. Next, select **Enable** to enable selected networks with service endpoints for "Microsoft.AzureCosmosDB". When it's complete, select **Add**.
40
40
41
41

42
42
@@ -72,13 +72,13 @@ To ensure that you have access to Azure Cosmos DB metrics from the portal, you n
72
72
73
73
1. From the **All resources** blade, find the Azure Cosmos DB account for which you assigned service endpoints.
74
74
75
-
2. Select **Firewalls and virtual networks** from the settings menu.
75
+
1. Select **Firewalls and virtual networks** from the settings menu.
76
76
77
-
3. To remove a virtual network or subnet rule, select **...** next to the virtual network or subnet, and select **Remove**.
77
+
1. To remove a virtual network or subnet rule, select **...** next to the virtual network or subnet, and select **Remove**.
78
78
79
79

80
80
81
-
4. Select **Save** to apply your changes.
81
+
1. Select **Save** to apply your changes.
82
82
83
83
## <aid="configure-using-powershell"></a>Configure a service endpoint by using Azure PowerShell
84
84
@@ -92,91 +92,58 @@ Use the following steps to configure a service endpoint to an Azure Cosmos DB ac
92
92
1. Enable the service endpoint for an existing subnet of a virtual network.
1. Run the following command to verify that your Azure Cosmos DB account is updated with the virtual network service endpoint that you configured in the previous step:
## <aid="configure-using-cli"></a>Configure a service endpoint by using the Azure CLI
@@ -289,88 +256,47 @@ az network vnet subnet update \
289
256
290
257
## <aid="migrate-from-firewall-to-vnet"></a>Migrating from an IP firewall rule to a virtual network ACL
291
258
292
-
Use the following steps only for Azure Cosmos DB accounts with existing IP firewall rules that allow a subnet, when you want to use virtual network and subnet-based ACLs instead of an IP firewall rule.
259
+
To migrate an Azure Cosmos DB account from using IP firewall rules to using virtual network service endpoints, use the following steps.
293
260
294
-
After a service endpoint for an Azure Cosmos DB account is turned on for a subnet, the requests are sent with a source that contains virtual network and subnet information instead of a public IP. These requests don't match an IP filter. This source switch happens for all Azure Cosmos DB accounts accessed from the subnet with a service endpoint enabled. To prevent downtime, use the following steps:
261
+
After an Azure Cosmos DB account is configured for a service endpoint for a subnet, requests from that subnet are sent to Azure Cosmos DB with virtual network and subnet source information instead of a source public IP address. These requests will no longer match an IP filter configured on the Azure Cosmos DB account, which is why the following steps are necessary to avoid downtime.
295
262
296
-
1. Get properties of the Azure Cosmos DB account by running the following cmdlet:
Before proceeding, enable the Azure Cosmos DB service endpoint on the virtual network and subnet using the step shown above in "Enable the service endpoint for an existing subnet of a virtual network".
308
264
309
-
1.Initialize the variables to use them later. Set up all the variables from the existing account definition. Add the virtual network ACL to all Azure Cosmos DB accounts being accessed from the subnet with `ignoreMissingVNetServiceEndpoint` flag.
265
+
1.Get virtual network and subnet information:
310
266
311
267
```powershell
312
-
$locations = @()
268
+
$resourceGroupName = "myResourceGroup"
269
+
$accountName = "mycosmosaccount"
270
+
$vnetName = "myVnet"
271
+
$subnetName = "mySubnet"
313
272
314
-
foreach ($readLocation in $cosmosDBConfiguration.Properties.readLocations) {
0 commit comments