Skip to content

Commit 0d2ac51

Browse files
authored
[Identity] Clarify subscription error in AZ CLI cred (#39501)
Signed-off-by: Paul Van Eck <[email protected]>
1 parent 9379d2e commit 0d2ac51

File tree

1 file changed

+4
-3
lines changed
  • sdk/identity/azure-identity/azure/identity/_internal

1 file changed

+4
-3
lines changed

sdk/identity/azure-identity/azure/identity/_internal/utils.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def validate_subscription(subscription: str) -> None:
8181
"""
8282
if not subscription or any(c not in VALID_SUBSCRIPTION_CHARACTERS for c in subscription):
8383
raise ValueError(
84-
"Invalid subscription provided. You can locate your subscription by following the "
85-
"instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id"
84+
f"Subscription '{subscription}' contains invalid characters. If this is the name of a subscription, use "
85+
"its ID instead. You can locate your subscription by following the instructions listed here: "
86+
"https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id"
8687
)
8788

8889

@@ -91,7 +92,7 @@ def resolve_tenant(
9192
tenant_id: Optional[str] = None,
9293
*,
9394
additionally_allowed_tenants: Optional[List[str]] = None,
94-
**_
95+
**_,
9596
) -> str:
9697
"""Returns the correct tenant for a token request given a credential's configuration.
9798

0 commit comments

Comments
 (0)