Skip to content

Commit bc22d23

Browse files
[Network] - Update New-AzPublicIpPrefix and New-AzPublicIpAddress to require Location parameter (#22909)
* Update New-AzPublicIpPrefix to require Location parameter * Update changelog.md * Update New-AzPublicIpAddress * Create BreakingChangeIssues.csv for network --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent f6b2f51 commit bc22d23

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Updated cmdlet `New-AzPublicIpPrefix` and `New-PublicIpAddress` to require Location parameter
2223
* Updated cmdlet `New-AzLoadBalancerBackendAddressPool` to support managed IP based backend
2324
* Added cmdlet `New-AzSaaSNetworkVirtualAppliance` for creating a NetworkVirtualAppliance of SaaS type.
2425

src/Network/Network/PublicIpAddress/NewAzurePublicIpAddressCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class NewAzurePublicIpAddressCommand : PublicIpAddressBaseCmdlet
4949
public virtual string ResourceGroupName { get; set; }
5050

5151
[Parameter(
52-
Mandatory = false,
52+
Mandatory = true,
5353
ValueFromPipelineByPropertyName = true,
5454
HelpMessage = "The public IP address location.")]
5555
[LocationCompleter("Microsoft.Network/publicIPAddresses")]

src/Network/Network/PublicIpPrefix/NewAzurePublicIpPrefixCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class NewAzurePublicIpPrefixCommand : PublicIpPrefixBaseCmdlet
4747
public virtual string ResourceGroupName { get; set; }
4848

4949
[Parameter(
50-
Mandatory = false,
50+
Mandatory = true,
5151
ValueFromPipelineByPropertyName = true,
5252
HelpMessage = "The public IP prefix location.")]
5353
[LocationCompleter("Microsoft.Network/publicIPPrefixes")]

src/Network/Network/help/New-AzPublicIpAddress.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ Creates a public IP address.
1414
## SYNTAX
1515

1616
```
17-
New-AzPublicIpAddress [-Name <String>] -ResourceGroupName <String> [-Location <String>] [-EdgeZone <String>]
17+
New-AzPublicIpAddress [-Name <String>] -ResourceGroupName <String> -Location <String> [-EdgeZone <String>]
1818
[-Sku <String>] [-Tier <String>] -AllocationMethod <String> [-IpAddressVersion <String>]
19-
[-DomainNameLabel <String>] [-DomainNameLabelScope <String>][-IpTag <PSPublicIpTag[]>] [-PublicIpPrefix <PSPublicIpPrefix>]
20-
[-DdosProtectionMode <String>] [-DdosProtectionPlanId <String>] [-ReverseFqdn <String>]
21-
[-IdleTimeoutInMinutes <Int32>] [-Zone <String[]>] [-IpAddress <String>] [-Tag <Hashtable>] [-Force] [-AsJob]
22-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
19+
[-DomainNameLabel <String>] [-DomainNameLabelScope <PSDomainNameLabelScopeType>] [-IpTag <PSPublicIpTag[]>]
20+
[-PublicIpPrefix <PSPublicIpPrefix>] [-DdosProtectionMode <String>] [-DdosProtectionPlanId <String>]
21+
[-ReverseFqdn <String>] [-IdleTimeoutInMinutes <Int32>] [-Zone <String[]>] [-IpAddress <String>]
22+
[-Tag <Hashtable>] [-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
23+
[<CommonParameters>]
2324
```
2425

2526
## DESCRIPTION
@@ -202,7 +203,7 @@ Accept wildcard characters: False
202203
Specifies the HashedReusePolicy for DNS name for a public IP address.
203204
204205
```yaml
205-
Type: System.String
206+
Type: System.Nullable`1[Microsoft.Azure.Commands.Network.Models.PSDomainNameLabelScopeType]
206207
Parameter Sets: (All)
207208
Aliases:
208209
Accepted values: TenantReuse, SubscriptionReuse, ResourceGroupReuse, NoReuse
@@ -313,7 +314,7 @@ Type: System.String
313314
Parameter Sets: (All)
314315
Aliases:
315316

316-
Required: False
317+
Required: True
317318
Position: Named
318319
Default value: None
319320
Accept pipeline input: True (ByPropertyName)

src/Network/Network/help/New-AzPublicIpPrefix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Creates a Public IP Prefix
1313
## SYNTAX
1414

1515
```
16-
New-AzPublicIpPrefix -Name <String> -ResourceGroupName <String> [-Location <String>] [-Sku <String>]
16+
New-AzPublicIpPrefix -Name <String> -ResourceGroupName <String> -Location <String> [-Sku <String>]
1717
[-Tier <String>] -PrefixLength <UInt16> [-IpAddressVersion <String>] [-IpTag <PSPublicIpPrefixTag[]>]
1818
[-Zone <String[]>] [-CustomIpPrefix <PSCustomIpPrefix>] [-EdgeZone <String>] [-Tag <Hashtable>] [-Force]
1919
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
@@ -165,7 +165,7 @@ Type: System.String
165165
Parameter Sets: (All)
166166
Aliases:
167167

168-
Required: False
168+
Required: True
169169
Position: Named
170170
Default value: None
171171
Accept pipeline input: True (ByPropertyName)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"Module","ClassName","Target","Severity","ProblemId","Description","Remediation"
2+
"Az.Network","Microsoft.Azure.Commands.Network.NewAzurePublicIpAddressCommand","New-AzPublicIpAddress","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzPublicIpAddress' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzPublicIpAddress'."
3+
"Az.Network","Microsoft.Azure.Commands.Network.NewAzurePublicIpPrefixCommand","New-AzPublicIpPrefix","0","1050","The parameter set '__AllParameterSets' for cmdlet 'New-AzPublicIpPrefix' has been removed.","Add parameter set '__AllParameterSets' back to cmdlet 'New-AzPublicIpPrefix'."

0 commit comments

Comments
 (0)