@@ -3,10 +3,10 @@ title: Azure Notification Hubs Private Link (preview)
3
3
description : Learn how to use the Private Link feature in Azure Notification Hubs.
4
4
author : sethmanheim
5
5
ms.author : sethm
6
+ ms.date : 02/02/2024
6
7
ms.service : notification-hubs
7
8
ms.custom : devx-track-azurecli, devx-track-azurepowershell
8
9
ms.topic : conceptual
9
- ms.date : 12/12/2023
10
10
---
11
11
12
12
# Use Private Link (preview)
@@ -50,101 +50,6 @@ The following procedure creates a private endpoint along with a new notification
50
50
51
51
:::image type="content" source="media/private-link/create-properties.png" alt-text="Screenshot of private link creation properties." lightbox="media/private-link/create-properties.png":::
52
52
53
- ## Create a private endpoint using PowerShell
54
-
55
- The following example shows how to use PowerShell to create a private endpoint connection to a Notification Hubs namespace. Your private endpoint uses a private IP address in your virtual network.
56
-
57
- 1 . Sign in to Azure via PowerShell and set a subscription:
58
-
59
- ``` powershell
60
- Login-AzAccount
61
- Set-AzContext -SubscriptionId <azure_subscription_id>
62
- ```
63
-
64
- 1 . Create a new resource group:
65
-
66
- ``` powershell
67
- New-AzResourceGroup -Name <resource_group_name> -Location <azure_region>
68
- ```
69
-
70
- 1 . Register ** Microsoft.NotificationHubs** as a resource provider:
71
-
72
- ``` powershell
73
- Register-AzResourceProvider -ProviderNamespace Microsoft.NotificationHubs
74
- ```
75
-
76
- 1 . Create a new Azure Notification Hubs namespace:
77
-
78
- ``` powershell
79
- New-AzNotificationHubsNamespace -ResourceGroup <resource_group_name> -Location <azure_region> -Namespace <namespace_name> -SkuTier "Standard"
80
- ```
81
-
82
- 1 . Create a new notification hub. First, create a JSON file with the notification hub details. This file is used as an input to the create notification hub PowerShell command. Paste the following content into the JSON file:
83
-
84
- ``` json
85
- {
86
- "ResourceGroup" : " resource_group_name" ,
87
- "NamespaceName" : " namespace_name" ,
88
- "Location" : " azure_region" ,
89
- "Name" : " notification_hub_name"
90
- }
91
- ```
92
-
93
- 1 . Run the following PowerShell command:
94
-
95
- ``` powershell
96
- New-AzNotificationHub -ResourceGroup <resource_group_name> -Namespace <namespace_name> -InputFile <path_to_json_file>
97
- ```
98
-
99
- 1 . Create a virtual network with a subnet:
100
-
101
- ``` powershell
102
- New-AzVirtualNetwork -ResourceGroup <resource_group_name> -Location <azure_region> -Name <your_VNet_name> -AddressPrefix <address_prefix>
103
- Add-AzVirtualNetworkSubnetConfig -VirtualNetwork (Get-AzVirtualNetwork -Name <your_VNet_name> -ResourceGroup <resource_group_name>) -Name <subnet_name> -AddressPrefix <address_prefix>
104
- ```
105
-
106
- 1 . Disable virtual network policies:
107
-
108
- ``` powershell
109
- $net = @{
110
- Name = 'myVNet'
111
- ResourceGroupName = 'RG'
112
- }
113
- $vnet = Get-AzVirtualNetwork @net
114
-
115
- $sub = @{
116
- Name = <subnet_name>
117
- VirtualNetwork = $vnet
118
- PrivateEndpointNetworkPoliciesFlag = 'Disabled'
119
- }
120
- Set-AzVirtualNetworkSubnetConfig @sub
121
- ```
122
-
123
- 1 . Add private DNS zones and link them to the virtual network:
124
-
125
- ``` powershell
126
- New-AzPrivateDnsZone -ResourceGroup <resource_group_name> -Name privatelink.servicebus.windows.net
127
- New-AzPrivateDnsZone -ResourceGroup <resource_group_name> -Name privatelink.notificationhub.windows.net
128
-
129
- New-AzPrivateDnsVirtualNetworkLink -ResourceGroup <resource_group_name> -Name <dns_Zone_Link_Name> -ZoneName "privatelink.servicebus.windows.net" -VirtualNetworkId "/subscriptions/<azure_subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.Network/virtualNetworks/<vNet_name>"
130
-
131
- New-AzPrivateDnsVirtualNetworkLink -ResourceGroup <resource_group_name> -Name <dns_Zone_Link_Name> -ZoneName "privatelink.notificationhub.windows.net" -VirtualNetworkId "/subscriptions/<azure_subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.Network/virtualNetworks/<vNet_name>"
132
- ```
133
-
134
- 1 . Create a private endpoint:
135
-
136
- ``` powershell
137
- $plsConnection= New-AzPrivateLinkServiceConnection -Name <private_link_connection_name> -PrivateLinkServiceId '/subscriptions/<azure_subscription_id> /resourceGroups/<resource_group_name>/providers/Microsoft.NotificationHubs/namespaces/<namespace_name>'
138
-
139
- New-AzPrivateEndpoint -ResourceGroup <resource_group_name> -Location <azure_region> -Name <private_endpoint_name> -Subnet (Get-AzVirtualNetworkSubnetConfig -Name <subnet_name> -VirtualNetwork (Get-AzVirtualNetwork -Name <vNet_name> -ResourceGroup <resource_group_name>)) -PrivateLinkServiceConnection $plsConnection
140
- ```
141
-
142
- 1 . Show the connection status:
143
-
144
- ``` powershell
145
- Get-AzPrivateEndpointConnection -ResourceGroup <resource_group_name> -Name <private_endpoint_name>
146
- ```
147
-
148
53
## Create a private endpoint using CLI
149
54
150
55
1 . Sign in to Azure CLI and set a subscription:
0 commit comments