diff --git a/cli/azd/cmd/auth_login.go b/cli/azd/cmd/auth_login.go index 6103f737c70..da3ad426607 100644 --- a/cli/azd/cmd/auth_login.go +++ b/cli/azd/cmd/auth_login.go @@ -338,7 +338,7 @@ func (la *loginAction) Run(ctx context.Context) (*actions.ActionResult, error) { return nil, err } - if la.flags.clientID == "" { + if v, err := strconv.ParseBool(os.Getenv("AZD_DEBUG_LOGIN_FORCE_SUBSCRIPTION_REFRESH")); (err == nil && v) || la.flags.clientID == "" { // Update the subscriptions cache for regular users (i.e. non-service-principals). // The caching is done here to increase responsiveness of listing subscriptions in the application. // It also allows an implicit command for the user to refresh cached subscriptions. diff --git a/eng/pipelines/templates/jobs/build-cli.yml b/eng/pipelines/templates/jobs/build-cli.yml index 6eaaabb44d0..aa2b013818a 100644 --- a/eng/pipelines/templates/jobs/build-cli.yml +++ b/eng/pipelines/templates/jobs/build-cli.yml @@ -101,6 +101,7 @@ jobs: AZURESUBSCRIPTION_TENANT_ID: $(AzureSubscriptionTenantId) AZURESUBSCRIPTION_SERVICE_CONNECTION_ID: $(AzureSubscriptionServiceConnectionId) SYSTEM_ACCESSTOKEN: $(System.AccessToken) + AZD_DEBUG_LOGIN_FORCE_SUBSCRIPTION_REFRESH: true displayName: AZD Login - task: AzureCLI@2