question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Service principal context left in inconsistent state after `az account list --refresh`

See original GitHub issue

Repro steps:

# use a clean configuration directory
export AZURE_CONFIG_DIR="$(pwd)/foo"

az login --service-principal --username ...

# at this point, everything should work; for instance, az keyvault list should return whatever keyvaults your service principal can read
az keyvault list

# refreshing the account list leaves the account configuration in an inconsistent state.
az account list --refresh

# this command fails and prints "Could not retrieve credential from local cache for service principal None. Run `az login` for this service principal."
az keyvault list

# if you look in $AZURE_CONFIG_DIR/azureProfile.json, you will see that the "user" field of every subscription object is null now

It seems like a regression in 2.30.0, likely due to #19707

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jiaslicommented, Nov 19, 2021

I see. I can reproduce this issue. Actually az account list --refresh is always problematic, even in ADAL-based Azure CLI. We are considering to deprecate --refresh (#20429).

Anyway, let me fix this issue for now.

0reactions
jackhortoncommented, Nov 19, 2021

Thank you for the quick fix! We will investigate whether we still need this functionality at all and if so, switch to az account clear; az login

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sign in with Azure CLI — Login and Authentication
Sign in interactively; Sign in with credentials on the command line; Sign in with a service principal; Sign in with a different tenant ......
Read more >
Develop Azure Digital Twins (ADT) solutions
TIP: Click the Refresh button in the MODELS explorer to update the list of models. The uploaded Cheese Factory - Interface Model should...
Read more >
State Operations Manual Appendix PP - CMS
When providing care and services, staff must respect each resident's individuality, as well as honor and value their input. GUIDANCE §483.10(a)-(b)(1)&(2).
Read more >
Tracking regulatory changes in the Biden era
The Brookings Center on Regulation and Markets Regulatory Tracker (“Reg Tracker”) provides background information and status updates on a ...
Read more >
Guardmaster Configurable Safety Relay User Manual
by Rockwell Automation to describe industrial automation systems. The following is a list of specific terms and abbreviations that are used in this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found