Skip to content

[FEATURE REQ] Check subscription id early and provide more friendly error message #945

@Flanker32

Description

@Flanker32

Is your feature request related to a problem? Please describe.

We are building java toolkit based on azure java library, and we found the error message is a bit confusing when subscription is set to null. Related issue. This could be reproduced when you auth with an Microsoft account without any subscription

Describe the solution you'd like
We could throw specific kind of Exception(like 'AzureAuthException') and show more friendly error message("Subscription Id is not specified"), or we could set error code to indicate this is an auth issue.

Describe alternatives you've considered
We could check subscription early, like in the auth stage
- We could check whether specified subs is exist and throw correspond exception in method withSubscription
- We could check whether there are available subscription in current account in method withDefaultSubscription

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Metadata

Metadata

Labels

AuthenticationMgmtIssues that refer to the management plane

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions