Skip to content

Defining the subscription is mandatory sometimes #27586

Description

@TimoRiikonenIF

Describe the bug

Subscription must be defined if you have basic user permissions to the subscription

According to the document, this should work:
Set-AzContext --SubscriptionName "1234"
az group list --output table
But it gives an empty result if you have basic permissions to the subscription.

On the other hand this works still:
Set-AzContext --SubscriptionName "1234"
az group list --output table --SubscriptionName "1234"

Related command

Other az commands have the same issue, such as az cognitiveservices account show

Errors

Empty result, which is wrong result

Issue script & Debug output

Set-AzContext --SubscriptionName "1234"
az group list --output table --SubscriptionName "1234"

Expected behavior

Lists resource groups in the subscription that you have access to.

Environment Summary

azure-cli 2.49.0 *

core 2.49.0 *
telemetry 1.0.8 *

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Additional context

There is another defect as well with this command in an unusual environment, but I didn't figure out how to solve that.

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamCognitive Servicesaz cognitiveservicesService AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-squadact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions