From 3beaaeacc5d753a02d2175e68896dd4dad7d8d8e Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:16:13 +0530 Subject: [PATCH 1/5] {AzureSubscription} fixes Azure/azure-powershell#20812 fix the workload parameter fixes Azure/azure-powershell#20812 While we run the PS cmdlet `New-AzSubscriptionAlias` it fails with the error: New-AzSubscriptionAlias -AliasName MyTestAlias -BillingScope '/providers/Microsoft.Billing/billingAccounts/XXXXXX/enrollmentAccounts/XXXXXX' -SubscriptionName MysSubscription New-AzSubscriptionAlias: Operation returned an invalid status code 'BadRequest' Debug output: { "error": { "code": "InvalidWorkLoad", "message": "Invalid WorkLoad provided, Only Production or DevTest are allowed" }, "code": "InvalidWorkLoad", "message": "Invalid WorkLoad provided, Only Production or DevTest are allowed" } This PR makes the workload parameter mandatory to avoid the above error. --- .../Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Subscription/Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs b/src/Subscription/Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs index 27034ead4b9b..9502f4db71e1 100644 --- a/src/Subscription/Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs +++ b/src/Subscription/Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs @@ -50,7 +50,7 @@ public ISubscriptionClient SubscriptionClient [Parameter(Mandatory = false, HelpMessage = "Billing Scope")] public string BillingScope { get; set; } - [Parameter(Mandatory = false, HelpMessage = "Type of Workload")] + [Parameter(Mandatory = true, HelpMessage = "Type of Workload")] [PSArgumentCompleter("Production", "DevTest")] public string Workload { get; set; } From 81f266fc64940785904bcb3f6447481216f2d34f Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:16:17 +0530 Subject: [PATCH 2/5] Update ChangeLog.md --- src/Subscription/Subscription/ChangeLog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Subscription/Subscription/ChangeLog.md b/src/Subscription/Subscription/ChangeLog.md index 5eb2d8ea8b45..a38a1772e3b7 100644 --- a/src/Subscription/Subscription/ChangeLog.md +++ b/src/Subscription/Subscription/ChangeLog.md @@ -19,6 +19,9 @@ --> ## Upcoming Release +## Version 0.8.2 +* Fix for the `New-AzSubscriptionAlias` cmdlet to make the Workload parameter mandatory. + ## Version 0.8.1 * Updated Microsoft.Azure.Management.Subscription .Net SDK version to 2.0.0 From 25d4ecbec3b46ba01103894d79bccdad1cb74864 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Mon, 6 Feb 2023 10:44:25 +0530 Subject: [PATCH 3/5] Update src/Subscription/Subscription/ChangeLog.md Co-authored-by: Beisi Zhou --- src/Subscription/Subscription/ChangeLog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Subscription/Subscription/ChangeLog.md b/src/Subscription/Subscription/ChangeLog.md index a38a1772e3b7..78d2e4c525e9 100644 --- a/src/Subscription/Subscription/ChangeLog.md +++ b/src/Subscription/Subscription/ChangeLog.md @@ -18,8 +18,6 @@ - Additional information about change #1 --> ## Upcoming Release - -## Version 0.8.2 * Fix for the `New-AzSubscriptionAlias` cmdlet to make the Workload parameter mandatory. ## Version 0.8.1 From 477abdf19d99056ca4081c46258b299287efe6ea Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Mon, 6 Feb 2023 10:57:02 +0530 Subject: [PATCH 4/5] Updating the help docs for New-AzSubscriptionAlias --- src/Subscription/Subscription/help/New-AzSubscriptionAlias.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Subscription/Subscription/help/New-AzSubscriptionAlias.md b/src/Subscription/Subscription/help/New-AzSubscriptionAlias.md index a8e9caa4233e..1b1d5578b49c 100644 --- a/src/Subscription/Subscription/help/New-AzSubscriptionAlias.md +++ b/src/Subscription/Subscription/help/New-AzSubscriptionAlias.md @@ -146,14 +146,14 @@ Accept wildcard characters: False ``` ### -Workload -Type of Workload +Type of Workload. Accepted values: DevTest, Production. ```yaml Type: System.String Parameter Sets: (All) Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False From f503ca96aaf691ac16cad33e0fa6996972cdcbd2 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Mon, 6 Feb 2023 13:28:24 +0800 Subject: [PATCH 5/5] Update src/Subscription/Subscription/ChangeLog.md --- src/Subscription/Subscription/ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Subscription/Subscription/ChangeLog.md b/src/Subscription/Subscription/ChangeLog.md index 78d2e4c525e9..f221f27cd46e 100644 --- a/src/Subscription/Subscription/ChangeLog.md +++ b/src/Subscription/Subscription/ChangeLog.md @@ -18,7 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release -* Fix for the `New-AzSubscriptionAlias` cmdlet to make the Workload parameter mandatory. +* Fixed `New-AzSubscriptionAlias` cmdlet to make the Workload parameter mandatory. ## Version 0.8.1 * Updated Microsoft.Azure.Management.Subscription .Net SDK version to 2.0.0