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-private-endpoints.md
+198-3Lines changed: 198 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ foreach ($IPConfiguration in $networkInterface.IpConfigurations)
180
180
181
181
## Create a private endpoint by using a Resource Manager template
182
182
183
-
You can set up Private Link by creating a private endpoint in a virtual network subnet. You achieve this by using an Azure Resource Manager template.
183
+
You can set up Private Link by creating a private endpoint in a virtual network subnet. You achieve this by using an Azure Resource Manager template.
184
184
185
185
Use the following code to create a Resource Manager template named "PrivateEndpoint_template.json." This template creates a private endpoint for an existing Azure Cosmos SQL API account in an existing virtual network.
186
186
@@ -241,7 +241,7 @@ Use the following code to create a Resource Manager template named "PrivateEndpo
241
241
}
242
242
```
243
243
244
-
### Define the parameters file for the template
244
+
**Define the parameters file for the template**
245
245
246
246
Create a parameters file for the template, and name it "PrivateEndpoint_parameters.json." Add the following code to the parameters file:
247
247
@@ -266,7 +266,7 @@ Create a parameters file for the template, and name it "PrivateEndpoint_paramete
266
266
}
267
267
```
268
268
269
-
### Deploy the template by using a PowerShell script
269
+
**Deploy the template by using a PowerShell script**
270
270
271
271
Create a PowerShell script by using the following code. Before you run the script, replace the subscription ID, resource group name, and other variable values with the details for your environment.
272
272
@@ -330,6 +330,201 @@ After the template is deployed successfully, you can see an output similar to wh
330
330
331
331
After the template is deployed, the private IP addresses are reserved within the subnet. The firewall rule of the Azure Cosmos account is configured to accept connections from the private endpoint only.
332
332
333
+
### Integrate the private endpoint with a Private DNS Zone
334
+
335
+
Use the following code to create a Resource Manager template named "PrivateZone_template.json." This template creates a private DNS zone for an existing Azure Cosmos SQL API account in an existing virtual network.
**Deploy the template by using a PowerShell script**
446
+
447
+
Create a PowerShell script by using the following code. Before you run the script, replace the subscription ID, resource group name, and other variable values with the details for your environment.
448
+
449
+
```azurepowershell-interactive
450
+
### This script:
451
+
### - creates a private zone
452
+
### - creates a private endpoint for an existing Cosmos DB account in an existing VNet
453
+
### - maps the private endpoint to the private zone
454
+
455
+
## Step 1: Fill in these details. Replace the variable values with the details for your environment.
456
+
$SubscriptionId = "<your Azure subscription ID>"
457
+
# Resource group where the Azure Cosmos account and virtual network resources are located
458
+
$ResourceGroupName = "myResourceGroup"
459
+
# Name of the Azure Cosmos account
460
+
$CosmosDbAccountName = "mycosmosaccount"
461
+
# API type of the Azure Cosmos account. It can be one of the following: "Sql", "MongoDB", "Cassandra", "Gremlin", "Table"
462
+
$CosmosDbApiType = "Sql"
463
+
# Name of the existing virtual network
464
+
$VNetName = "myVnet"
465
+
# Name of the target subnet in the virtual network
You should use a private DNS zone within the subnet where you've created the private endpoint. Configure the endpoints so that each private IP address is mapped to a DNS entry. (See the `fqdns` property in the response shown earlier.)
0 commit comments