Skip to the content.

Previous page >

Content

This template creates an Azure Private Endpoint based on your Network Topology, you can also use it to create the associated DNS private record.

Comments:

Deployment through the Portal

Deployment through the PowerShell


## Variable
$AzureRmSubscriptionName = "mvp-sub1"
$RgName = "dld-corp-mvp-dataplatform"

$existingResourceName = "dldcorpmvpadls"
$existingResourceType = "Microsoft.Storage/storageAccounts"
$groupId = "blob"
$resourcePrivateEndpointIteration = "1"
$DeploymentName = "$($existingResourceName)-pe$($resourcePrivateEndpointIteration)"

$existingVirtualNetworkResourceGroupName = "jdld-we-demo-wvd-rg1"
$existingVirtualNetworkName = "jdld-we-demo-wvd-vnet1"
$existingVirtualNetworkSubnetName = "endpoint-snet1"

$privateDnsZoneResourceGroupName = "infr-hub-prd-rg1"
$privateDnsZoneName = "privatelink.blob.core.windows.net"

## Connectivity
# Login first with Connect-AzAccount if not using Cloud Shell
$AzureRmContext = Get-AzSubscription -SubscriptionName $AzureRmSubscriptionName | Set-AzContext -ErrorAction Stop
Select-AzSubscription -Name $AzureRmSubscriptionName -Context $AzureRmContext -Force -ErrorAction Stop

## Action
Write-Host "Deploying : $DeploymentName in the resource group : $RgName" -ForegroundColor Cyan
New-AzResourceGroupDeployment -Name "$($existingResourceName)-pe$($resourcePrivateEndpointIteration)" -ResourceGroupName $RgName `
  -TemplateUri https://raw.githubusercontent.com/JamesDLD/AzureRm-Template/master/Create-AzPrivateEnpoints/template.json `
  -existingResourceName $existingResourceName `
  -groupIds @($groupId) `
  -resourcePrivateEndpointIteration $resourcePrivateEndpointIteration `
  -existingResourceType $existingResourceType `
  -existingVirtualNetworkResourceGroupName $existingVirtualNetworkResourceGroupName `
  -existingVirtualNetworkName $existingVirtualNetworkName `
  -existingVirtualNetworkSubnetName $existingVirtualNetworkSubnetName `
  -privateDnsZoneResourceGroupName $privateDnsZoneResourceGroupName `
  -privateDnsZoneName $privateDnsZoneName `
  -Confirm -ErrorAction Stop