Skip to content

Commit

Permalink
{AzureSubscription} fixes #20812 fix the workload parameter
Browse files Browse the repository at this point in the history
fixes #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.
  • Loading branch information
navba-MSFT authored Feb 3, 2023
1 parent fc2fa77 commit 3beaaea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit 3beaaea

Please sign in to comment.