Skip to content

Commit c21cc3f

Browse files
{AzureSubscription} fixes Azure#20812 fix the workload parameter (Azure#20842)
* {AzureSubscription} fixes Azure#20812 fix the workload parameter fixes Azure#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. * Update ChangeLog.md * Update src/Subscription/Subscription/ChangeLog.md Co-authored-by: Beisi Zhou <[email protected]> * Updating the help docs for New-AzSubscriptionAlias * Update src/Subscription/Subscription/ChangeLog.md --------- Co-authored-by: Beisi Zhou <[email protected]>
1 parent 563a918 commit c21cc3f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Subscription/Subscription/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed `New-AzSubscriptionAlias` cmdlet to make the Workload parameter mandatory.
2122

2223
## Version 0.8.1
2324
* Updated Microsoft.Azure.Management.Subscription .Net SDK version to 2.0.0

src/Subscription/Subscription/Cmdlets/NewAzureRmSubscriptionAlias.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ISubscriptionClient SubscriptionClient
5050
[Parameter(Mandatory = false, HelpMessage = "Billing Scope")]
5151
public string BillingScope { get; set; }
5252

53-
[Parameter(Mandatory = false, HelpMessage = "Type of Workload")]
53+
[Parameter(Mandatory = true, HelpMessage = "Type of Workload")]
5454
[PSArgumentCompleter("Production", "DevTest")]
5555
public string Workload { get; set; }
5656

src/Subscription/Subscription/help/New-AzSubscriptionAlias.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ Accept wildcard characters: False
146146
```
147147
148148
### -Workload
149-
Type of Workload
149+
Type of Workload. Accepted values: DevTest, Production.
150150
151151
```yaml
152152
Type: System.String
153153
Parameter Sets: (All)
154154
Aliases:
155155

156-
Required: False
156+
Required: True
157157
Position: Named
158158
Default value: None
159159
Accept pipeline input: False

0 commit comments

Comments
 (0)