Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

ohmyzsh plugin to view current account #17340

Open NissesSenap opened 3 years ago

NissesSenap commented 3 years ago

Is your feature request related to a problem? Please describe.

Half the AZ commands i run is "az account list -o table" to see what subscirption is active since I switch between allot of customers + dev, qa and prod.

Describe the solution you'd like

I would like to see what subscirptioon that is active in my shell preferably without calling the az api every 5 min . So some kind of cache would be needed.

Describe alternatives you've considered

It dosen't have to be a https://ohmyz.sh/ plugin but it would be nice. But if you could manage a bash scripts that helps out with this a bunch of us in the community don't have to solve the same thing :).

Additional context

This is how my current zsh shell looks like: ~/projects/random-proj on main [!?] at ☸️ v1.19.7 aks-prod (monitor). It informs me where I'm currently located, how clean my git environment currently is and what namespace and context I'm using for kubernetes.

I would like to see ~/projects/random-proj on main [!?] at ☸️ v1.19.7 aks-prod (monitor) (azure logo) Subscirption-name

NissesSenap commented 3 years ago

Hmm got a tip from a colleague. We should be able to use ~/.azure/azureProfile.json and see which subscription currently have "isDefault": true

yonzhan commented 3 years ago

account