Skip to content

Commit 982e593

Browse files
vidai-msftisra-fel
andauthored
Fixed required parameters missing for *-AzPrivateEndpointConnection. (Azure#19178)
* Fixed required parameters missing for *-AzPrivateEndpointConnection. * Update ChangeLog.md * Update BreakingChangeIssues.csv * Update src/Network/Network/ChangeLog.md Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com>
1 parent 8621c2c commit 982e593

12 files changed

+81
-44
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020

2121
## Upcoming Release
2222
* Fixed a bug that removes existing resource tags during a Set-AzFirewallPolicy command
23+
* Fixed required parameter `PrivateLinkResourceType` missing issue for the following cmdlets [#18655]
24+
- `Get-AzPrivateEndpointConnection`
25+
- `Set-AzPrivateEndpointConnection`
26+
- `Remove-AzPrivateEndpointConnection`
27+
- `Approve-AzPrivateEndpointConnection`
28+
- `Deny-AzPrivateEndpointConnection`
2329
* Added breaking change attribute to notify that public ip address sku default behaviour will be changed
2430
- `New-AzPublicIpAddress`
2531
- `New-AzLoadBalancer`

src/Network/Network/PrivateLinkService/PrivateEndpointConnection/ApproveAzurePrivateEndpointConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public override void Execute()
5252
this.PrivateLinkResourceType = resourceIdentifier.ResourceType.Substring(0,resourceIdentifier.ResourceType.LastIndexOf('/'));
5353
this.ServiceName = resourceIdentifier.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
5454
}
55+
else if (this.IsParameterBound(c => c.PrivateLinkResourceType))
56+
{
57+
this.Subscription = DefaultProfile.DefaultContext.Subscription.Id;
58+
this.PrivateLinkResourceType = DynamicParameters[privateEndpointTypeName].Value as string;
59+
}
5560

5661
IPrivateLinkProvider provider = BuildProvider(this.Subscription, this.PrivateLinkResourceType);
5762

src/Network/Network/PrivateLinkService/PrivateEndpointConnection/DenyAzurePrivateEndpointConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public override void Execute()
5252
this.PrivateLinkResourceType = resourceIdentifier.ResourceType.Substring(0, resourceIdentifier.ResourceType.LastIndexOf('/'));
5353
this.ServiceName = resourceIdentifier.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
5454
}
55+
else if (this.IsParameterBound(c => c.PrivateLinkResourceType))
56+
{
57+
this.Subscription = DefaultProfile.DefaultContext.Subscription.Id;
58+
this.PrivateLinkResourceType = DynamicParameters[privateEndpointTypeName].Value as string;
59+
}
5560

5661
IPrivateLinkProvider provider = BuildProvider(this.Subscription, this.PrivateLinkResourceType);
5762

src/Network/Network/PrivateLinkService/PrivateEndpointConnection/RemoveAzurePrivateEndpointConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public override void Execute()
6565
this.PrivateLinkResourceType = resourceIdentifier.ResourceType.Substring(0, resourceIdentifier.ResourceType.LastIndexOf('/'));
6666
this.ServiceName = resourceIdentifier.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
6767
}
68+
else if (this.IsParameterBound(c => c.PrivateLinkResourceType))
69+
{
70+
this.Subscription = DefaultProfile.DefaultContext.Subscription.Id;
71+
this.PrivateLinkResourceType = DynamicParameters[privateEndpointTypeName].Value as string;
72+
}
6873

6974
IPrivateLinkProvider provider = BuildProvider(this.Subscription, this.PrivateLinkResourceType);
7075

src/Network/Network/PrivateLinkService/PrivateEndpointConnection/SetAzurePrivateEndpointConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public override void Execute()
6060
this.PrivateLinkResourceType = resourceIdentifier.ResourceType.Substring(0, resourceIdentifier.ResourceType.LastIndexOf('/'));
6161
this.ServiceName = resourceIdentifier.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
6262
}
63+
else if (this.IsParameterBound(c => c.PrivateLinkResourceType))
64+
{
65+
this.Subscription = DefaultProfile.DefaultContext.Subscription.Id;
66+
this.PrivateLinkResourceType = DynamicParameters[privateEndpointTypeName].Value as string;
67+
}
6368

6469
IPrivateLinkProvider provider = BuildProvider(this.Subscription, this.PrivateLinkResourceType);
6570

src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/ProviderConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static bool TryGetEndpointConnectionServiceParameter(string name, string
126126
name, typeof(string),
127127
new Collection<Attribute>()
128128
{
129-
new ParameterAttribute { Mandatory = false,
129+
new ParameterAttribute { Mandatory = true,
130130
ValueFromPipeline = true,
131131
HelpMessage = "The resource provider and resource type which supports private endpoint connection.",
132132
ParameterSetName = parameterSetName },

src/Network/Network/help/Approve-AzPrivateEndpointConnection.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ Approve-AzPrivateEndpointConnection -ResourceId <String> [-Description <String>]
2020

2121
### ByResource
2222
```
23-
Approve-AzPrivateEndpointConnection -Name <String> -ServiceName <String> -ResourceGroupName <String>
24-
[-PrivateLinkResourceType <string>][-Description <String>]
25-
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
23+
Approve-AzPrivateEndpointConnection -Name <String> -ResourceGroupName <String> -ServiceName <String> -PrivateLinkResourceType <String>
24+
[-Description <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2625
```
2726

2827
## DESCRIPTION
@@ -32,7 +31,7 @@ The **Approve-AzPrivateEndpointConnection** cmdlet approves a private endpoint c
3231

3332
### Example 1
3433
```powershell
35-
Approve-AzPrivateEndpointConnection -Name TestPrivateEndpointConnection -ResourceGroupName TestResourceGroup -ServiceName TestPrivateLinkService
34+
Approve-AzPrivateEndpointConnection -Name TestPrivateEndpointConnection -ResourceGroupName TestResourceGroup -ServiceName TestPrivateLinkService -PrivateLinkResourceType Microsoft.Network/privateLinkServices
3635
```
3736

3837
This example approves a private endpoint connection.
@@ -92,10 +91,10 @@ Type: System.String
9291
Parameter Sets: ByResource
9392
Aliases:
9493

95-
Required: False
94+
Required: True
9695
Position: Named
97-
Default value: 'Microsoft.Network/privateLinkServices'
98-
Accept pipeline input: True (ByPropertyName)
96+
Default value: None
97+
Accept pipeline input: True (ByValue)
9998
Accept wildcard characters: False
10099
```
101100
@@ -144,7 +143,6 @@ Accept pipeline input: True (ByPropertyName)
144143
Accept wildcard characters: False
145144
```
146145
147-
148146
### CommonParameters
149147
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
150148

src/Network/Network/help/Deny-AzPrivateEndpointConnection.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ Deny-AzPrivateEndpointConnection -ResourceId <String> [-Description <String>]
2020

2121
### ByResource
2222
```
23-
Deny-AzPrivateEndpointConnection -Name <String> -ServiceName <String> -ResourceGroupName <String>
24-
[-PrivateLinkResourceType <string>] [-Description <String>]
25-
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
23+
Deny-AzPrivateEndpointConnection -Name <String> -ResourceGroupName <String> -ServiceName <String> -PrivateLinkResourceType <String>
24+
[-Description <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2625
```
2726

2827
## DESCRIPTION
@@ -32,7 +31,7 @@ The **Deny-AzPrivateEndpointConnection** cmdlet denies a private endpoint connec
3231

3332
### Example 1
3433
```powershell
35-
Deny-AzPrivateEndpointConnection -Name TestPrivateEndpointConnection -ResourceGroupName TestResourceGroup -ServiceName TestPrivateLinkService
34+
Deny-AzPrivateEndpointConnection -Name TestPrivateEndpointConnection -ResourceGroupName TestResourceGroup -ServiceName TestPrivateLinkService -PrivateLinkResourceType Microsoft.Network/privateLinkServices
3635
```
3736

3837
This example denies a private endpoint connection.
@@ -92,10 +91,10 @@ Type: System.String
9291
Parameter Sets: ByResource
9392
Aliases:
9493

95-
Required: False
94+
Required: True
9695
Position: Named
97-
Default value: 'Microsoft.Network/privateLinkServices'
98-
Accept pipeline input: True (ByPropertyName)
96+
Default value: None
97+
Accept pipeline input: True (ByValue)
9998
Accept wildcard characters: False
10099
```
101100

src/Network/Network/help/Get-AzPrivateEndpointConnection.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gets a private endpoint connection resource.
1414

1515
### ByResourceId (Default)
1616
```
17-
Get-AzPrivateEndpointConnection [-Description <String>] -ResourceId <String>
17+
Get-AzPrivateEndpointConnection -ResourceId <String> [-Description <String>]
1818
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1919
```
2020

@@ -26,9 +26,8 @@ Get-AzPrivateEndpointConnection -PrivateLinkResourceId <String> [-Description <S
2626

2727
### ByResource
2828
```
29-
Get-AzPrivateEndpointConnection [-Description <String>] [-Name <String>] -ResourceGroupName <String>
30-
-ServiceName <String> [-DefaultProfile <IAzureContextContainer>] [-PrivateLinkResourceType <String>]
31-
[<CommonParameters>]
29+
Get-AzPrivateEndpointConnection -ResourceGroupName <String> -ServiceName <String> -PrivateLinkResourceType <String>
30+
[-Name <String>] [-Description <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
3231
```
3332

3433
## DESCRIPTION
@@ -45,7 +44,7 @@ This example return a list of all private endpoint connections belongs to sql se
4544

4645
### Example 2
4746
```powershell
48-
Get-AzPrivateEndpointConnection -Name MyPrivateEndpointConnection1 -ResourceGroupName TestResourceGroup -ServiceName MyPrivateLinkService -PrivateLinkResourceType 'Microsoft.Network/privateLinkServices'
47+
Get-AzPrivateEndpointConnection -Name MyPrivateEndpointConnection1 -ResourceGroupName TestResourceGroup -ServiceName MyPrivateLinkService -PrivateLinkResourceType Microsoft.Network/privateLinkServices
4948
```
5049

5150
This example get a private endpoint connection named MyPrivateEndpointConnection1 belongs to private link service named MyPrivateLinkService
@@ -94,7 +93,7 @@ Required: False
9493
Position: Named
9594
Default value: None
9695
Accept pipeline input: True (ByPropertyName)
97-
Accept wildcard characters: False
96+
Accept wildcard characters: True
9897
```
9998
10099
### -PrivateLinkResourceId
@@ -119,11 +118,10 @@ The private link resource type.
119118
Type: System.String
120119
Parameter Sets: ByResource
121120
Aliases:
122-
Accepted values:
123121

124-
Required: False
122+
Required: True
125123
Position: Named
126-
Default value: 'Microsoft.Network/privateLinkServices'
124+
Default value: None
127125
Accept pipeline input: True (ByValue)
128126
Accept wildcard characters: False
129127
```

src/Network/Network/help/Remove-AzPrivateEndpointConnection.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ Removes a private endpoint connection.
1414

1515
### ByResourceId (Default)
1616
```
17-
Remove-AzPrivateEndpointConnection -ResourceId <String>
18-
[-Force] [-AsJob] [-PassThru]
17+
Remove-AzPrivateEndpointConnection -ResourceId <String> [-Description <String>] [-Force] [-AsJob] [-PassThru]
1918
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2019
```
2120

2221
### ByResource
2322
```
24-
Remove-AzPrivateEndpointConnection -Name <String> -ServiceName <String> -ResourceGroupName <String>
25-
[-PrivateLinkResourceType <String>] [-Force] [-AsJob] [-PassThru]
26-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
23+
Remove-AzPrivateEndpointConnection -Name <String> -ResourceGroupName <String> -ServiceName <String> -PrivateLinkResourceType <String>
24+
[-Description <String>] [-Force] [-AsJob] [-PassThru] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2725
```
2826

2927
## DESCRIPTION
@@ -33,7 +31,7 @@ The **Remove-AzPrivateEndpointConnection** cmdlet removes a private endpoint con
3331

3432
### Example 1
3533
```powershell
36-
Remove-AzPrivateEndpointConnection -Name MyPrivateEndpointConnection1 -ResourceGroupName TestResourceGroup -ServiceName MyPrivateLinkServiceName
34+
Remove-AzPrivateEndpointConnection -Name MyPrivateEndpointConnection1 -ResourceGroupName TestResourceGroup -ServiceName MyPrivateLinkServiceName -PrivateLinkResourceType Microsoft.Network/privateLinkServices
3735
```
3836

3937
This example remove a private endpoint connection named MyPrivateEndpointConnection1
@@ -70,6 +68,21 @@ Accept pipeline input: False
7068
Accept wildcard characters: False
7169
```
7270
71+
### -Description
72+
The reason of action.
73+
74+
```yaml
75+
Type: System.String
76+
Parameter Sets: (All)
77+
Aliases:
78+
79+
Required: False
80+
Position: Named
81+
Default value: None
82+
Accept pipeline input: True (ByPropertyName)
83+
Accept wildcard characters: False
84+
```
85+
7386
### -Force
7487
Do not ask for confirmation if you want to delete resource
7588
@@ -124,10 +137,10 @@ Type: System.String
124137
Parameter Sets: ByResource
125138
Aliases:
126139

127-
Required: False
140+
Required: True
128141
Position: Named
129-
Default value: 'Microsoft.Network/privateLinkServices'
130-
Accept pipeline input: True (ByPropertyName)
142+
Default value: None
143+
Accept pipeline input: True (ByValue)
131144
Accept wildcard characters: False
132145
```
133146

0 commit comments

Comments
 (0)