Skip to content

az login not honoring core.login_experience_v2 = off #30109

Description

@danmacode

Describe the bug

When using az login --allow-no-subscriptions --tenant 'abcd1234-1234-1234-1234-1234abcd1234' --output none it does not honor the local configuration file.

Related command

Set the local config to not use the interactive login experience:

$ az --version
azure-cli                         2.61.0

$ az config --local set core.login_experience_v2=off

Verify that local config has core.login_experience_v2 disabled and global config is unset:

$ az config get core.login_experience_v2
Configuration 'core.login_experience_v2'is not set.

$ az config get --local core.login_experience_v2
{
  ...
  "value: "off"
}

Try to connect specifying a tenant id:

$ az login --allow-no-subscriptions --tenant 'abcd1234-1234-1234-1234-1234abcd1234' --output none

However, it prompts the user to select a subscription. If global config is set to core.login_experience_v2=off then there's no prompt.

Errors

No errors

Issue script & Debug output

Retrieving tenants and subscriptions for the selection...

[Tenant and subscription selection]

No     Subscription name                  Subscription ID                       Tenant
-----  ---------------------------------  ------------------------------------  ---------
[1]    Some sub                1231123123 Some tenant

Expected behavior

az login --allow-no-subscriptions --tenant 'abcd1234-1234-1234-1234-1234abcd1234' --output none should not prompt the user to select a subscription

Environment Summary

azure-cli                         2.65.0

core                              2.65.0
telemetry                          1.1.0

Extensions:
account                            0.2.5
automation                       1.0.0b1
init                               0.1.0
next                               0.1.3

Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\danmacode\.azure\cliextensions'

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb  6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]

Additional context

No response

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamConfigureaz configure/configact-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

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions