Service principal context left in inconsistent state after `az account list --refresh`
See original GitHub issueRepro 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:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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