Skip to content

Commit b923a97

Browse files
author
Jill Grant
authored
Merge pull request #289736 from mbender-ms/nsp-final-001
network security perimeter - final edits
2 parents 0105612 + 9d2d2fd commit b923a97

13 files changed

+251
-228
lines changed

articles/private-link/create-network-security-perimeter-cli.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: azure-private-link
77
ms.topic: quickstart
8-
ms.date: 10/30/2024
8+
ms.date: 11/06/2024
99
#CustomerIntent: As a network administrator, I want to create a network security perimeter for an Azure resource using Azure CLI, so that I can control the network traffic to and from the resource.
1010
---
1111

@@ -18,19 +18,16 @@ Get started with network security perimeter by creating a network security perim
1818
## Prerequisites
1919

2020
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21+
22+
[!INCLUDE [network-security-perimeter-add-preview](../../includes/network-security-perimeter-add-preview.md)]
23+
2124
- The [latest Azure CLI](/cli/azure/install-azure-cli), or you can use Azure Cloud Shell in the portal.
2225
- This article **requires version 2.38.0 or later** of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
2326
- After upgrading to the latest version of Azure CLI, import the network security perimeter commands using `az extension add --name nsp`.
24-
- Re-register the `Microsoft.Network` resource provider with the following command:
25-
26-
```azure
27-
az provider register --namespace Microsoft.Network
28-
```
2927

3028
[!INCLUDE [azure-cli-prepare-your-environment.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
3129

3230

33-
[!INCLUDE [network-security-perimeter-add-preview](../../includes/network-security-perimeter-add-preview.md)]
3431

3532

3633
## Connect to your Azure account and select your subscription
@@ -49,7 +46,7 @@ To get started, connect to [Azure Cloud Shell](https://shell.azure.com) or use y
4946
5047
```azurecli-interactive
5148
# List all subscriptions
52-
az account set --subscription "Azure Subscription"
49+
az account set --subscription <Azure Subscription>
5350
5451
# Re-register the Microsoft.Network resource provider
5552
az provider register --namespace Microsoft.Network
@@ -58,23 +55,22 @@ To get started, connect to [Azure Cloud Shell](https://shell.azure.com) or use y
5855
## Create a resource group and key vault
5956
6057
Before you can create a network security perimeter, you have to create a resource group and a key vault resource.
61-
This example creates a resource group named **test-rg** in the WestCentralUS location and a key vault named **key-vault-YYYYDDMM** in the resource group with the following commands:
58+
This example creates a resource group named **resource-group** in the WestCentralUS location and a key vault named **key-vault-YYYYDDMM** in the resource group with the following commands:
6259
6360
```azurecli-interactive
6461
az group create \
65-
--name test-rg \
62+
--name resource-group \
6663
--location westcentralus
6764
6865
# Create a key vault using a datetime value to ensure a unique name
6966
7067
key_vault_name="key-vault-$(date +%s)"
7168
az keyvault create \
7269
--name $key_vault_name \
73-
--resource-group test-rg \
70+
--resource-group resource-group \
7471
--location westcentralus \
7572
--query 'id' \
7673
--output tsv
77-
7874
```
7975

8076
## Create a network security perimeter
@@ -87,7 +83,7 @@ In this step, create a network security perimeter with the `az network perimeter
8783
```azurecli-interactive
8884
az network perimeter create\
8985
--name network-security-perimeter \
90-
--resource-group test-rg \
86+
--resource-group resource-group \
9187
-l westcentralus
9288
```
9389

@@ -104,7 +100,7 @@ In this step, you create a new profile and associate the PaaS resource, the Azur
104100
# Create a new profile
105101
az network perimeter profile create \
106102
--name network-perimeter-profile \
107-
--resource-group test-rg \
103+
--resource-group resource-group \
108104
--perimeter-name network-security-perimeter
109105
110106
```
@@ -115,21 +111,21 @@ In this step, you create a new profile and associate the PaaS resource, the Azur
115111
# Get key vault id
116112
az keyvault show \
117113
--name $key_vault_name \
118-
--resource-group test-rg \
114+
--resource-group resource-group \
119115
--query 'id'
120116
121117
# Get the profile id
122118
az network perimeter profile show \
123119
--name network-perimeter-profile \
124-
--resource-group test-rg \
120+
--resource-group resource-group \
125121
--perimeter-name network-security-perimeter
126122
127123
# Associate the Azure Key Vault with the network security perimeter profile
128124
# Replace <PaaSArmId> and <networkSecurityPerimeterProfileId> with the ID values for your key vault and profile
129125
az network perimeter association create \
130126
--name network-perimeter-association \
131127
--perimeter-name network-security-perimeter \
132-
--resource-group test-rg \
128+
--resource-group resource-group \
133129
--access-mode Learning \
134130
--private-link-resource "{id:<PaaSArmId>}" \
135131
--profile "{id:<networkSecurityPerimeterProfileId>}"
@@ -142,15 +138,15 @@ In this step, you create a new profile and associate the PaaS resource, the Azur
142138
az network perimeter association create \
143139
--name network-perimeter-association \
144140
--perimeter-name network-security-perimeter \
145-
--resource-group test-rg \
141+
--resource-group resource-group \
146142
--access-mode Enforced \
147143
--private-link-resource "{id:<PaaSArmId>}" \
148144
--profile "{id:<networkSecurityPerimeterProfileId>}"
149145
```
146+
147+
## Manage network security perimeter access rules
150148
151-
## Create and update network security perimeter access rules
152-
153-
In this step, you create and update network security perimeter access rules with public IP address prefixes using the `az network perimeter profile access-rule create` command.
149+
In this step, you create, update, and delete a network security perimeter access rules with public IP address prefixes using the `az network perimeter profile access-rule` command.
154150
155151
1. Create an inbound access rule with a public IP address prefix for the profile created with the following command:
156152
@@ -161,7 +157,7 @@ In this step, you create and update network security perimeter access rules with
161157
--name access-rule \
162158
--profile-name network-perimeter-profile \
163159
--perimeter-name network-security-perimeter \
164-
--resource-group test-rg \
160+
--resource-group resource-group \
165161
--address-prefixes "[192.0.2.0/24]"
166162
167163
```
@@ -175,12 +171,22 @@ In this step, you create and update network security perimeter access rules with
175171
--name access-rule \
176172
--profile-name network-perimeter-profile \
177173
--perimeter-name network-security-perimeter \
178-
--resource-group test-rg \
174+
--resource-group resource-group \
179175
--address-prefixes "['198.51.100.0/24', '192.0.2.0/24']"
180176
181177
```
182178
183-
[!INCLUDE [network-security-perimeter-note-managed-id](../../includes/network-security-perimeter-note-managed-id.md)]
179+
1. If you need to delete an access rule, use the following command:
180+
181+
```azurepowershell-interactive
182+
# Delete the access rule
183+
az network perimeter profile access-rule delete \
184+
--Name network-perimeter-association \
185+
--profile-name network-perimeter-profile \
186+
--perimeter-name network-security-perimeter \
187+
--resource-group resource-group
188+
189+
[!INCLUDE [network-security-perimeter-note-managed-id](../../includes/network-security-perimeter-note-managed-id.md)]
184190
185191
## Delete all resources
186192
@@ -191,27 +197,29 @@ To delete a network security perimeter and other resources in this quickstart, u
191197
# Delete the network security perimeter association
192198
az network perimeter association delete \
193199
--name network-perimeter-association \
194-
--resource-group test-rg \
200+
--resource-group resource-group \
195201
--perimeter-name network-security-perimeter
196202
197203
# Delete the network security perimeter
198204
az network perimeter delete \
199-
--resource-group test-rg \
205+
--resource-group resource-group \
200206
--name network-security-perimeter --yes
201207
202208
# Delete the key vault
203209
az keyvault delete \
204210
--name $key_vault_name \
205-
--resource-group test-rg
211+
--resource-group resource-group
206212
207213
# Delete the resource group
208214
az group delete \
209-
--name test-rg \
215+
--name resource-group \
210216
--yes \
211217
--no-wait
212218
213219
```
214220

221+
[!INCLUDE [network-security-perimeter-delete-resources](../../includes/network-security-perimeter-delete-resources.md)]
222+
215223
## Next steps
216224

217225
> [!div class="nextstepaction"]

articles/private-link/create-network-security-perimeter-portal.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: azure-private-link
77
ms.topic: quickstart
8-
ms.date: 10/30/2024
8+
ms.date: 11/04/2024
99
#CustomerIntent: As a network administrator, I want to create a network security perimeter for an Azure resource in the Azure portal, so that I can control the network traffic to and from the resource.
1010
---
1111

@@ -98,9 +98,12 @@ When you no longer need a network security perimeter, you remove any resources a
9898

9999
1. From your network security perimeter, select **Associated resources** under **Settings**.
100100
2. Select **key-vault-YYYYDDMM** from the list of associated resources.
101-
3. From the action bar,select **Settings ** and then select **Remove** in the .
101+
3. From the action bar, select **Settings ** and then select **Remove** in the confirmation window.
102102
4. Navigate back to the **Overview** page of your network security perimeter.
103103
5. Select **Delete** and confirm the deletion by entering **network-security-perimeter** in the text box for the name of the resource.
104+
6. Browse to the **resource-group** and select **Delete** to remove the resource group and all resources within it.
105+
106+
[!INCLUDE [network-security-perimeter-delete-resources](../../includes/network-security-perimeter-delete-resources.md)]
104107

105108
## Next steps
106109

articles/private-link/create-network-security-perimeter-powershell.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: azure-private-link
77
ms.topic: quickstart
8-
ms.date: 09/16/2024
8+
ms.date: 11/06/2024
99
#CustomerIntent: As a network administrator, I want to create a network security perimeter for an Azure resource using Azure PowerShell, so that I can control the network traffic to and from the resource.
1010
---
1111

1212
# Quickstart: Create a network security perimeter - Azure PowerShell
1313

14-
Get started with network security perimeter by creating a network security perimeter for an Azure key vault using Azure PowerShell. A [network security perimeter](network-security-perimeter-concepts.md) allows [Azure Platform as a Service (PaaS)](./network-security-perimeter-concepts.md#onboarded-private-link-resources) resources to communicate within an explicit trusted boundary. Next, You create and update a PaaS resources association in a network security perimeter profile. Then you create and update network security perimeter access rules. When you're finished, you delete all resources created in this quickstart.
14+
Get started with network security perimeter by creating a network security perimeter for an Azure key vault using Azure PowerShell. A [network security perimeter](network-security-perimeter-concepts.md) allows [Azure Platform as a Service (PaaS)](./network-security-perimeter-concepts.md#onboarded-private-link-resources) resources to communicate within an explicit trusted boundary. You create and update a PaaS resource's association in a network security perimeter profile. Then you create and update network security perimeter access rules. When you're finished, you delete all resources created in this quickstart.
1515

1616
[!INCLUDE [network-security-perimeter-preview-message](../../includes/network-security-perimeter-preview-message.md)]
1717

@@ -24,30 +24,42 @@ Get started with network security perimeter by creating a network security perim
2424
- The latest version of the Azure PowerShell module with tools for network security perimeter.
2525

2626
```azurepowershell
27+
# Install the Az.Tools.Installer module
2728
Install-Module -Name Az.Tools.Installer -Repository PSGallery
2829
```
2930
3031
- Use `Az.Tools.Installer` to install the preview build of the `Az.Network`:
3132
3233
```azurepowershell-interactive
34+
# Install the preview build of the Az.Network module
3335
Install-Module -Name Az.Tools.Installer -Repository PSGallery -allowprerelease -force
34-
Install-AzModule -Name Az.Network -AllowPrerelease -Force
35-
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.6.1-preview.nupkg
36-
```
3736
38-
- Register the Microsoft.Network resource provider:
37+
# List the current versions of the Az.Network module available in the PowerShell Gallery
38+
Find-Module -Name Az.Network -Allversions -AllowPrerelease
3939
40-
```azurepowershell-interactive
41-
# Register the Microsoft.Network resource provider
42-
Register-AzResourceProvider -ProviderNamespace Microsoft.Network
40+
# Install the preview build of the Az.Network module using the
41+
42+
Install-AzModule -Name Az.Network -AllowPrerelease -Force
43+
Install-AzModule -Path <previewVersionNumber>
4344
```
45+
> [!NOTE]
46+
> The preview version of the Az.Network module is required to use network security perimeter capabilities. The latest version of the Az.Network module is available in the PowerShell Gallery. Look for the newest version that ends in `-preview`.
4447
45-
* If you choose to use Azure PowerShell locally:
46-
* [Install the latest version of the Az PowerShell module](/powershell/azure/install-azure-powershell).
47-
* Connect to your Azure account using the
48+
- If you choose to use Azure PowerShell locally:
49+
- [Install the latest version of the Az PowerShell module](/powershell/azure/install-azure-powershell).
50+
- Connect to your Azure account using the
4851
[Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet.
49-
* If you choose to use Azure Cloud Shell:
50-
* For more information on Azure Cloud Shell, see [Overview of Azure Cloud Shell](/azure/cloud-shell/overview).
52+
- If you choose to use Azure Cloud Shell:
53+
- For more information on Azure Cloud Shell, see [Overview of Azure Cloud Shell](/azure/cloud-shell/overview).
54+
- To get help with the PowerShell cmdlets, use the `Get-Help` command:
55+
```azurepowershell-interactive
56+
57+
# Get help for a specific command
58+
get-help -Name <powershell-command> - full
59+
60+
# Example
61+
get-help -Name New-AzNetworkSecurityPerimeter - full
62+
```
5163
5264
## Sign in to your Azure account and select your subscription
5365
@@ -66,7 +78,6 @@ Set-AzContext -Subscription <subscriptionId>
6678
6779
# Register the Microsoft.Network resource provider
6880
Register-AzResourceProvider -ProviderNamespace Microsoft.Network
69-
7081
```
7182

7283
## Create a resource group and key vault
@@ -164,9 +175,9 @@ In this step, you create a new profile and associate the PaaS resource, the Azur
164175
Update-AzNetworkSecurityPerimeterAssociation @updateAssociation | format-list
165176
```
166177
167-
## Create and update network security perimeter access rules
178+
## Manage network security perimeter access rules
168179
169-
In this step, you create and update network security perimeter access rules with public IP address prefixes.
180+
In this step, you create, update and delete network security perimeter access rules with public IP address prefixes.
170181
171182
```azurepowershell-interactive
172183
# Create an inbound access rule for a public IP address prefix
@@ -194,14 +205,14 @@ In this step, you create and update network security perimeter access rules with
194205

195206
[!INCLUDE [network-security-pe~rimeter-note-managed-id](../../includes/network-security-perimeter-note-managed-id.md)]
196207

197-
## Delete a network security perimeter
208+
## Delete all resources
198209

199-
To delete a network security perimeter, use the following commands:
210+
When you no longer need the network security perimeter, remove all resources associated with the network security perimeter, remove the perimeter, and then remove the resource group.
200211

201212
```azurepowershell-interactive
202213
203214
# Retrieve the network security perimeter and place it in a variable
204-
$nsp= Get-AzNetworkSecurityPerimeter -Name demo-nsp -ResourceGroupName $rg.name
215+
$nsp= Get-AzNetworkSecurityPerimeter -Name demo-nsp -ResourceGroupName $rg.Params.Name
205216
206217
# Delete the network security perimeter and all associated resources
207218
$removeNsp = @{
@@ -216,6 +227,8 @@ To delete a network security perimeter, use the following commands:
216227
# Remove the resource group
217228
Remove-AzResourceGroup -Name $rgParams.Name -Force
218229
```
230+
231+
[!INCLUDE [network-security-perimeter-delete-resources](../../includes/network-security-perimeter-delete-resources.md)]
219232

220233
## Next steps
221234

0 commit comments

Comments
 (0)