Skip to content

Commit f3b3564

Browse files
authored
Merge pull request #111388 from spelluru/ehubprivatedns0414
added the private zone section
2 parents 9bf153e + 1682192 commit f3b3564

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

articles/event-hubs/private-link-service.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,32 @@ $privateEndpoint = New-AzPrivateEndpoint -ResourceGroupName $rgName `
149149
150150
```
151151

152+
### Configure the private DNS Zone
153+
Create a private DNS zone for Event Hubs domain and create an association link with the virtual network:
154+
155+
```azurepowershell-interactive
156+
$zone = New-AzPrivateDnsZone -ResourceGroupName $rgName `
157+
-Name "privatelink.servicebus.windows.net"
158+
159+
$link = New-AzPrivateDnsVirtualNetworkLink -ResourceGroupName $rgName `
160+
-ZoneName "privatelink.servicebus.windows.net" `
161+
-Name "mylink" `
162+
-VirtualNetworkId $virtualNetwork.Id
163+
164+
$networkInterface = Get-AzResource -ResourceId $privateEndpoint.NetworkInterfaces[0].Id -ApiVersion "2019-04-01"
165+
166+
foreach ($ipconfig in $networkInterface.properties.ipConfigurations) {
167+
foreach ($fqdn in $ipconfig.properties.privateLinkConnectionProperties.fqdns) {
168+
Write-Host "$($ipconfig.properties.privateIPAddress) $($fqdn)"
169+
$recordName = $fqdn.split('.',2)[0]
170+
$dnsZone = $fqdn.split('.',2)[1]
171+
New-AzPrivateDnsRecordSet -Name $recordName -RecordType A -ZoneName "privatelink.servicebus.windows.net" `
172+
-ResourceGroupName $rgName -Ttl 600 `
173+
-PrivateDnsRecords (New-AzPrivateDnsRecordConfig -IPv4Address $ipconfig.properties.privateIPAddress)
174+
}
175+
}
176+
```
177+
152178
## Manage private endpoints using Azure portal
153179

154180
When you create a private endpoint, the connection must be approved. If the resource for which you're creating a private endpoint is in your directory, you can approve the connection request provided you have sufficient permissions. If you're connecting to an Azure resource in another directory, you must wait for the owner of that resource to approve your connection request.

0 commit comments

Comments
 (0)