Skip to content

Remove networkSecurityPerimeter based access rule creation/updation. #22433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Network/NetworkSecurityPerimeter.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- https://github.com/kaushal087/azure-rest-api-specs/blob/edd10769b1c1bc88bde274add8562beb13b118af/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
- https://github.com/kaushal087/azure-rest-api-specs/blob/01701c5f89029cedfb89e9e34a43fdedfeb8ab25/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
# - C:\repo\azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-swagger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ function Update-AzNetworkSecurityPerimeterAccessRule {
# Phone Numbers
${PhoneNumber},

[Parameter(HelpMessage = "Inbound rule specified by the perimeter id")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]]
# Inbound rule specified by the perimeter id
${Perimeter},

[Parameter(HelpMessage = "Direction")]
[Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Category('Body')]
[System.String]
Expand All @@ -202,7 +196,7 @@ function Update-AzNetworkSecurityPerimeterAccessRule {
# 1. GET

# body params and AsJob
$bodyParams = 'Tag', 'Location', 'AddressPrefix', 'FullyQualifiedDomainName', 'Perimeter', 'Direction', 'Subscription', 'EmailAddress', 'PhoneNumber', 'AsJob'
$bodyParams = 'Tag', 'Location', 'AddressPrefix', 'FullyQualifiedDomainName', 'Direction', 'Subscription', 'EmailAddress', 'PhoneNumber', 'AsJob'

$bodyParamsMap = @{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Creates or updates a network access rule.
New-AzNetworkSecurityPerimeterAccessRule -Name <String> -ProfileName <String> -ResourceGroupName <String>
-SecurityPerimeterName <String> [-SubscriptionId <String>] [-AccessRuleId <String>]
[-AddressPrefix <String[]>] [-Direction <AccessRuleDirection>] [-EmailAddress <String[]>]
[-FullyQualifiedDomainName <String[]>] [-Location <String>] [-Perimeter <IPerimeterBasedAccessRule[]>]
[-PhoneNumber <String[]>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>]
[-Confirm] [-WhatIf] [<CommonParameters>]
[-FullyQualifiedDomainName <String[]>] [-Location <String>] [-PhoneNumber <String[]>]
[-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

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

## DESCRIPTION
Expand All @@ -61,37 +61,6 @@ Location Name

Creates a NetworkSecurityPerimeterAccessRule

### Example 2: Creates a NetworkSecurityPerimeterAccessRule
```powershell

$perimeter1 = @{
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kaushal-nsp1'
perimeterGuid=''
location='eastus2euap'
}

$perimeter2 = @{
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kk-nsp4'
perimeterGuid='bcf8bf02-8b8a-4bcb-933d-2b575d94ec8f'
location='eastus2euap'
}

$networkSecurityPerimeters = @($perimeter1,$perimeter2)

New-AzNetworkSecurityPerimeterAccessRule -Name 'perimeter-ar' -SecurityPerimeterName 'testt-nsp1' -ProfileName 't-profile2' -ResourceGroupName 'ResourceGroup-1' -Direction 'Inbound' -Location 'eastus2euap' -Perimeter $networkSecurityPerimeters

```

```output

Location Name
-------- ----
perimeter_ar

```

Creates a NetworkSecurityPerimeterAccessRule

## PARAMETERS

### -AccessRuleId
Expand Down Expand Up @@ -246,22 +215,6 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Perimeter
Inbound rule specified by the perimeter id.
To construct, see NOTES section for PERIMETER properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PhoneNumber
Outbound rules phone number format.

Expand Down Expand Up @@ -443,15 +396,10 @@ To create the parameters described below, construct a hash table containing the
- `[Direction <AccessRuleDirection?>]`: Direction that specifies whether the access rules is inbound/outbound.
- `[EmailAddress <String[]>]`: Outbound rules email address format.
- `[FullyQualifiedDomainName <String[]>]`: Outbound rules fully qualified domain name format.
- `[NetworkSecurityPerimeter <IPerimeterBasedAccessRule[]>]`: Inbound rule specified by the perimeter id.
- `[Id <String>]`: NSP id in the ARM id format.
- `[PhoneNumber <String[]>]`: Outbound rules phone number format.
- `[Subscription <ISubscriptionId[]>]`: List of subscription ids
- `[Id <String>]`: Subscription id in the ARM id format.

`PERIMETER <IPerimeterBasedAccessRule[]>`: Inbound rule specified by the perimeter id.
- `[Id <String>]`: NSP id in the ARM id format.

`SUBSCRIPTION <ISubscriptionId[]>`: List of subscription ids
- `[Id <String>]`: Subscription id in the ARM id format.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,16 @@ Deletes an NSP Link resource.
Remove-AzNetworkSecurityPerimeterLink -Name t-linkD3 -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp8
```

```output

```

Remove network security perimeter link

### Example 2: Remove network security perimeter link via identity

```powershell
$linkObj = Get-AzNetworkSecurityPerimeterLink -Name t-linkD4 -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp10
Remove-AzNetworkSecurityPerimeterLink -InputObject $linkObj
```

```output

```

Remove network security perimeter link via identity


## PARAMETERS

### -AsJob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ Deletes an NSP LinkReference resource.
Remove-AzNetworkSecurityPerimeterLinkReference -ResourceGroupName psrg_ex -SecurityPerimeterName ext-nsp3 -Name Ref-from-t-link1-1738a5f3-78f8-4f1b-8f30-ffe0eaa74495
```

```output
```

Removes a network security perimeter link reference

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

```output
```

Removes a network security perimeter link reference via identity


## PARAMETERS

### -AsJob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Updates an access rule.
Update-AzNetworkSecurityPerimeterAccessRule -Name <String> -ProfileName <String> -ResourceGroupName <String>
-SecurityPerimeterName <String> [-SubscriptionId <String>] [-AddressPrefix <ArrayList>] [-Direction <String>]
[-EmailAddress <ArrayList>] [-FullyQualifiedDomainName <ArrayList>] [-Location <String>]
[-Perimeter <IPerimeterBasedAccessRule[]>] [-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>]
[-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
[-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>]
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### UpdateViaIdentityExpanded
```
Update-AzNetworkSecurityPerimeterAccessRule -InputObject <INetworkSecurityPerimeterIdentity>
[-AddressPrefix <ArrayList>] [-Direction <String>] [-EmailAddress <ArrayList>]
[-FullyQualifiedDomainName <ArrayList>] [-Location <String>] [-Perimeter <IPerimeterBasedAccessRule[]>]
[-PhoneNumber <ArrayList>] [-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>]
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
[-FullyQualifiedDomainName <ArrayList>] [-Location <String>] [-PhoneNumber <ArrayList>]
[-Subscription <ISubscriptionId[]>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
[-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -224,22 +224,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Perimeter
Inbound rule specified by the perimeter id
To construct, see NOTES section for PERIMETER properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkSecurityPerimeter.Models.Api20210201Preview.IPerimeterBasedAccessRule[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PhoneNumber
Phone Numbers

Expand Down Expand Up @@ -410,9 +394,6 @@ To create the parameters described below, construct a hash table containing the
- `[ResourceGroupName <String>]`: The name of the resource group.
- `[SubscriptionId <String>]`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

`PERIMETER <IPerimeterBasedAccessRule[]>`: Inbound rule specified by the perimeter id
- `[Id <String>]`: NSP id in the ARM id format.

`SUBSCRIPTION <ISubscriptionId[]>`: Subscription ids
- `[Id <String>]`: Subscription id in the ARM id format.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,16 @@ Creates a NetworkSecurityPerimeterAccessRule
### Example 2: Creates a NetworkSecurityPerimeterAccessRule
```powershell

$perimeter1 = @{
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kaushal-nsp1'
perimeterGuid=''
location='eastus2euap'
}

$perimeter2 = @{
id='/subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup-1/providers/Microsoft.Network/networkSecurityPerimeters/kk-nsp4'
perimeterGuid='bcf8bf02-8b8a-4bcb-933d-2b575d94ec8f'
location='eastus2euap'
}

$networkSecurityPerimeters = @($perimeter1,$perimeter2)

New-AzNetworkSecurityPerimeterAccessRule -Name 'perimeter-ar' -SecurityPerimeterName 'testt-nsp1' -ProfileName 't-profile2' -ResourceGroupName 'ResourceGroup-1' -Direction 'Inbound' -Location 'eastus2euap' -Perimeter $networkSecurityPerimeters
$emails = @("[email protected]", "[email protected]")
New-AzNetworkSecurityPerimeterAccessRule -Name accessRule2 -ProfileName profile2 -ResourceGroupName ResourceGroup-1 -SecurityPerimeterName nsp3 -EmailAddress $emails -Direction 'Outbound' -Location eastus2euap

```

```output

Location Name
-------- ----
perimeter_ar
accessRule2

```
Creates a NetworkSecurityPerimeterAccessRule
Loading