-
Couldn't load subscription status.
- Fork 4.1k
Closed
Labels
CXP Attention[Deprecated] The Azure CXP Support Team is responsible for this issue.[Deprecated] The Azure CXP Support Team is responsible for this issue.Subscriptioncustomer-reportedfeature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.
Description
Description of the new feature
Handle the error when New-AzSubscriptionAlias is run without the -Workload parameter with a more informative message, make the parameter required, or add a default.
New-AzSubscriptionAlias -AliasName MyTestAlias -BillingScope '/providers/Microsoft.Billing/billingAccounts/XXXXXX/enrollmentAccounts/XXXXXX' -SubscriptionName MysSubscription
New-AzSubscriptionAlias: Operation returned an invalid status code 'BadRequest'
This error isn't very helpful. If I add -Workload Production, the command succeeds.
Az.Subscription module version: 0.8.1
> $Error[0].Exception
Request : Microsoft.Rest.HttpRequestMessageWrapper
Response : Microsoft.Rest.HttpResponseMessageWrapper
Body : Microsoft.Azure.Management.Subscription.Models.ErrorResponseBody
TargetSite : Void MoveNext()
Message : Operation returned an invalid status code 'BadRequest'
Data : {}
InnerException :
HelpLink :
Source : Microsoft.Azure.Management.Subscription
HResult : -2146233088
StackTrace : at Microsoft.Azure.Management.Subscription.AliasOperations.BeginCreateWithHttpMessagesAsync(String aliasName, PutAliasRequest body, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Subscription.AliasOperations.CreateWithHttpMessagesAsync(String aliasName, PutAliasRequest body, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Subscription.AliasOperationsExtensions.CreateAsync(IAliasOperations operations, String aliasName, PutAliasRequest body, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Subscription.AliasOperationsExtensions.Create(IAliasOperations operations, String aliasName, PutAliasRequest body)
at Microsoft.Azure.Commands.Subscription.Cmdlets.NewAzureRmSubscriptionAlias.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
> $PSVersionTable
Name Value
---- -----
PSVersion 7.3.1
PSEdition Core
GitCommitId 7.3.1
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Proposed implementation details (optional)
No response
Metadata
Metadata
Assignees
Labels
CXP Attention[Deprecated] The Azure CXP Support Team is responsible for this issue.[Deprecated] The Azure CXP Support Team is responsible for this issue.Subscriptioncustomer-reportedfeature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.