Skip to content

Commit d40b0c5

Browse files
kaushal087Kaushal Kumar
andauthored
Remove networkSecurityPerimeter based access rule creation/updation. (#22433)
* Remove perimeter based access rule creation * remove perimeter based accesss rule from update access rule command * Recording test * Update examples * Remove perimeter based rule creation example --------- Co-authored-by: Kaushal Kumar <[email protected]>
1 parent db0f0b2 commit d40b0c5

File tree

30 files changed

+988
-2202
lines changed

30 files changed

+988
-2202
lines changed

src/Network/NetworkSecurityPerimeter.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ require:
3636
- $(this-folder)/../../readme.azure.noprofile.md
3737
input-file:
3838
# You need to specify your swagger files here.
39-
- https://github.com/kaushal087/azure-rest-api-specs/blob/edd10769b1c1bc88bde274add8562beb13b118af/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
39+
- https://github.com/kaushal087/azure-rest-api-specs/blob/01701c5f89029cedfb89e9e34a43fdedfeb8ab25/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
4040
# - C:\repo\azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
4141
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
4242
# - (this-folder)/relative-path-to-your-swagger

src/Network/NetworkSecurityPerimeter.Autorest/custom/Update-AzNetworkSecurityPerimeterAccessRule.ps1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ function Update-AzNetworkSecurityPerimeterAccessRule {
172172
# Phone Numbers
173173
${PhoneNumber},
174174

175-
[Parameter(HelpMessage = "Inbound rule specified by the perimeter id")]
176-
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Category('Body')]
177-
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]]
178-
# Inbound rule specified by the perimeter id
179-
${Perimeter},
180-
181175
[Parameter(HelpMessage = "Direction")]
182176
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Category('Body')]
183177
[System.String]
@@ -202,7 +196,7 @@ function Update-AzNetworkSecurityPerimeterAccessRule {
202196
# 1. GET
203197

204198
# body params and AsJob
205-
$bodyParams = 'Tag', 'Location', 'AddressPrefix', 'FullyQualifiedDomainName', 'Perimeter', 'Direction', 'Subscription', 'EmailAddress', 'PhoneNumber', 'AsJob'
199+
$bodyParams = 'Tag', 'Location', 'AddressPrefix', 'FullyQualifiedDomainName', 'Direction', 'Subscription', 'EmailAddress', 'PhoneNumber', 'AsJob'
206200

207201
$bodyParamsMap = @{}
208202

src/Network/NetworkSecurityPerimeter.Autorest/docs/New-AzNetworkSecurityPerimeterAccessRule.md

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Creates or updates a network access rule.
1717
New-AzNetworkSecurityPerimeterAccessRule -Name <String> -ProfileName <String> -ResourceGroupName <String>
1818
-SecurityPerimeterName <String> [-SubscriptionId <String>] [-AccessRuleId <String>]
1919
[-AddressPrefix <String[]>] [-Direction <AccessRuleDirection>] [-EmailAddress <String[]>]
20-
[-FullyQualifiedDomainName <String[]>] [-Location <String>] [-Perimeter <IPerimeterBasedAccessRule[]>]
21-
[-PhoneNumber <String[]>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>]
22-
[-Confirm] [-WhatIf] [<CommonParameters>]
20+
[-FullyQualifiedDomainName <String[]>] [-Location <String>] [-PhoneNumber <String[]>]
21+
[-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
22+
[<CommonParameters>]
2323
```
2424

2525
### Create
@@ -34,8 +34,8 @@ New-AzNetworkSecurityPerimeterAccessRule -Name <String> -ProfileName <String> -R
3434
New-AzNetworkSecurityPerimeterAccessRule -InputObject <INetworkSecurityPerimeterIdentity>
3535
[-AccessRuleId <String>] [-AddressPrefix <String[]>] [-Direction <AccessRuleDirection>]
3636
[-EmailAddress <String[]>] [-FullyQualifiedDomainName <String[]>] [-Location <String>]
37-
[-Perimeter <IPerimeterBasedAccessRule[]>] [-PhoneNumber <String[]>] [-Subscription <ISubscriptionId[]>]
38-
[-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
37+
[-PhoneNumber <String[]>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>]
38+
[-Confirm] [-WhatIf] [<CommonParameters>]
3939
```
4040

4141
## DESCRIPTION
@@ -61,37 +61,6 @@ Location Name
6161

6262
Creates a NetworkSecurityPerimeterAccessRule
6363

64-
### Example 2: Creates a NetworkSecurityPerimeterAccessRule
65-
```powershell
66-
67-
$perimeter1 = @{
68-
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kaushal-nsp1'
69-
perimeterGuid=''
70-
location='eastus2euap'
71-
}
72-
73-
$perimeter2 = @{
74-
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kk-nsp4'
75-
perimeterGuid='bcf8bf02-8b8a-4bcb-933d-2b575d94ec8f'
76-
location='eastus2euap'
77-
}
78-
79-
$networkSecurityPerimeters = @($perimeter1,$perimeter2)
80-
81-
New-AzNetworkSecurityPerimeterAccessRule -Name 'perimeter-ar' -SecurityPerimeterName 'testt-nsp1' -ProfileName 't-profile2' -ResourceGroupName 'ResourceGroup-1' -Direction 'Inbound' -Location 'eastus2euap' -Perimeter $networkSecurityPerimeters
82-
83-
```
84-
85-
```output
86-
87-
Location Name
88-
-------- ----
89-
perimeter_ar
90-
91-
```
92-
93-
Creates a NetworkSecurityPerimeterAccessRule
94-
9564
## PARAMETERS
9665

9766
### -AccessRuleId
@@ -246,22 +215,6 @@ Accept pipeline input: True (ByValue)
246215
Accept wildcard characters: False
247216
```
248217
249-
### -Perimeter
250-
Inbound rule specified by the perimeter id.
251-
To construct, see NOTES section for PERIMETER properties and create a hash table.
252-
253-
```yaml
254-
Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]
255-
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
256-
Aliases:
257-
258-
Required: False
259-
Position: Named
260-
Default value: None
261-
Accept pipeline input: False
262-
Accept wildcard characters: False
263-
```
264-
265218
### -PhoneNumber
266219
Outbound rules phone number format.
267220
@@ -443,15 +396,10 @@ To create the parameters described below, construct a hash table containing the
443396
- `[Direction <AccessRuleDirection?>]`: Direction that specifies whether the access rules is inbound/outbound.
444397
- `[EmailAddress <String[]>]`: Outbound rules email address format.
445398
- `[FullyQualifiedDomainName <String[]>]`: Outbound rules fully qualified domain name format.
446-
- `[NetworkSecurityPerimeter <IPerimeterBasedAccessRule[]>]`: Inbound rule specified by the perimeter id.
447-
- `[Id <String>]`: NSP id in the ARM id format.
448399
- `[PhoneNumber <String[]>]`: Outbound rules phone number format.
449400
- `[Subscription <ISubscriptionId[]>]`: List of subscription ids
450401
- `[Id <String>]`: Subscription id in the ARM id format.
451402

452-
`PERIMETER <IPerimeterBasedAccessRule[]>`: Inbound rule specified by the perimeter id.
453-
- `[Id <String>]`: NSP id in the ARM id format.
454-
455403
`SUBSCRIPTION <ISubscriptionId[]>`: List of subscription ids
456404
- `[Id <String>]`: Subscription id in the ARM id format.
457405

src/Network/NetworkSecurityPerimeter.Autorest/docs/Remove-AzNetworkSecurityPerimeterLink.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,16 @@ Deletes an NSP Link resource.
3535
Remove-AzNetworkSecurityPerimeterLink -Name t-linkD3 -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp8
3636
```
3737

38-
```output
39-
40-
```
41-
4238
Remove network security perimeter link
4339

4440
### Example 2: Remove network security perimeter link via identity
45-
4641
```powershell
4742
$linkObj = Get-AzNetworkSecurityPerimeterLink -Name t-linkD4 -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp10
4843
Remove-AzNetworkSecurityPerimeterLink -InputObject $linkObj
4944
```
5045

51-
```output
52-
53-
```
54-
5546
Remove network security perimeter link via identity
5647

57-
5848
## PARAMETERS
5949

6050
### -AsJob

src/Network/NetworkSecurityPerimeter.Autorest/docs/Remove-AzNetworkSecurityPerimeterLinkReference.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ Deletes an NSP LinkReference resource.
3535
Remove-AzNetworkSecurityPerimeterLinkReference -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp3 -Name Ref-from-t-link1-1738a5f3-78f8-4f1b-8f30-ffe0eaa74495
3636
```
3737

38-
```output
39-
```
40-
4138
Removes a network security perimeter link reference
4239

4340
### Example 2: Removes a network security perimeter link reference via identity
@@ -46,12 +43,8 @@ Removes a network security perimeter link reference
4643
Remove-AzNetworkSecurityPerimeterLinkReference -InputObject $linkRefObj
4744
```
4845

49-
```output
50-
```
51-
5246
Removes a network security perimeter link reference via identity
5347

54-
5548
## PARAMETERS
5649

5750
### -AsJob

src/Network/NetworkSecurityPerimeter.Autorest/docs/Update-AzNetworkSecurityPerimeterAccessRule.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ Updates an access rule.
1717
Update-AzNetworkSecurityPerimeterAccessRule -Name <String> -ProfileName <String> -ResourceGroupName <String>
1818
-SecurityPerimeterName <String> [-SubscriptionId <String>] [-AddressPrefix <ArrayList>] [-Direction <String>]
1919
[-EmailAddress <ArrayList>] [-FullyQualifiedDomainName <ArrayList>] [-Location <String>]
20-
[-Perimeter <IPerimeterBasedAccessRule[]>] [-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>]
21-
[-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
20+
[-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>]
21+
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
2222
```
2323

2424
### UpdateViaIdentityExpanded
2525
```
2626
Update-AzNetworkSecurityPerimeterAccessRule -InputObject <INetworkSecurityPerimeterIdentity>
2727
[-AddressPrefix <ArrayList>] [-Direction <String>] [-EmailAddress <ArrayList>]
28-
[-FullyQualifiedDomainName <ArrayList>] [-Location <String>] [-Perimeter <IPerimeterBasedAccessRule[]>]
29-
[-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>]
30-
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
28+
[-FullyQualifiedDomainName <ArrayList>] [-Location <String>] [-PhoneNumber <ArrayList>]
29+
[-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
30+
[-Confirm] [-WhatIf] [<CommonParameters>]
3131
```
3232

3333
## DESCRIPTION
@@ -224,22 +224,6 @@ Accept pipeline input: False
224224
Accept wildcard characters: False
225225
```
226226
227-
### -Perimeter
228-
Inbound rule specified by the perimeter id
229-
To construct, see NOTES section for PERIMETER properties and create a hash table.
230-
231-
```yaml
232-
Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]
233-
Parameter Sets: (All)
234-
Aliases:
235-
236-
Required: False
237-
Position: Named
238-
Default value: None
239-
Accept pipeline input: False
240-
Accept wildcard characters: False
241-
```
242-
243227
### -PhoneNumber
244228
Phone Numbers
245229
@@ -410,9 +394,6 @@ To create the parameters described below, construct a hash table containing the
410394
- `[ResourceGroupName <String>]`: The name of the resource group.
411395
- `[SubscriptionId <String>]`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
412396

413-
`PERIMETER <IPerimeterBasedAccessRule[]>`: Inbound rule specified by the perimeter id
414-
- `[Id <String>]`: NSP id in the ARM id format.
415-
416397
`SUBSCRIPTION <ISubscriptionId[]>`: Subscription ids
417398
- `[Id <String>]`: Subscription id in the ARM id format.
418399

src/Network/NetworkSecurityPerimeter.Autorest/examples/New-AzNetworkSecurityPerimeterAccessRule.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,16 @@ Creates a NetworkSecurityPerimeterAccessRule
1818
### Example 2: Creates a NetworkSecurityPerimeterAccessRule
1919
```powershell
2020
21-
$perimeter1 = @{
22-
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kaushal-nsp1'
23-
perimeterGuid=''
24-
location='eastus2euap'
25-
}
26-
27-
$perimeter2 = @{
28-
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kk-nsp4'
29-
perimeterGuid='bcf8bf02-8b8a-4bcb-933d-2b575d94ec8f'
30-
location='eastus2euap'
31-
}
32-
33-
$networkSecurityPerimeters = @($perimeter1,$perimeter2)
34-
35-
New-AzNetworkSecurityPerimeterAccessRule -Name 'perimeter-ar' -SecurityPerimeterName 'testt-nsp1' -ProfileName 't-profile2' -ResourceGroupName 'ResourceGroup-1' -Direction 'Inbound' -Location 'eastus2euap' -Perimeter $networkSecurityPerimeters
21+
22+
New-AzNetworkSecurityPerimeterAccessRule -Name accessRule2 -ProfileName profile2 -ResourceGroupName ResourceGroup-1 -SecurityPerimeterName nsp3 -EmailAddress $emails -Direction 'Outbound' -Location eastus2euap
3623
3724
```
3825

3926
```output
4027
4128
Location Name
4229
-------- ----
43-
perimeter_ar
30+
accessRule2
4431
4532
```
4633
Creates a NetworkSecurityPerimeterAccessRule

0 commit comments

Comments
 (0)