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.

az --version Getting permission denied exception after installing Azure CLI

See original GitHub issue

az --version Getting permission denied exception after installing Azure CLI

Describe the bug I installed Azure CLI’s latest version and have been not able to run commands over power shell or command prompt. I tried running as an Admin

C:\WINDOWS\system32> az --version
    Traceback (most recent call last):
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\_session.py", line 47, in load
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\_session.py", line 65, in save
      File "codecs.py", line 897, in open
    PermissionError: [Errno 13] Permission denied: 'C:\\Users\\mmodi\\.azure\\az.sess'
    
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "runpy.py", line 193, in _run_module_as_main
      File "runpy.py", line 85, in _run_code
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-clkvqii1\azure\cli\__main__.py", line 35, in <module>
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\__init__.py", line 848, in get_default_cli
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\__init__.py", line 65, in __init__
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\_session.py", line 61, in load
      File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-d55550gx\azure\cli\core\_session.py", line 65, in save
  File "codecs.py", line 897, in open
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\<User Name>\\.azure\\az.sess'

To Reproduce Installed Azure CLI and run any command. Ex az login , az --version

Expected behavior az commands should run

Environment summary

OS - Microsoft Windows 10 Enterprise (10.0.19041 Build 19041)
Azure CLI Version Installed (latest) -  2.10.1

Additional context

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
vinodkrishnakumarcommented, Oct 23, 2020

Hi,

I have this same issue even after deleting the file. Please help

2reactions
mtkyescommented, Oct 27, 2020

Also have the exact same problem in the cli

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied exception Azure CLI - Stack Overflow
I had a similar issue, I had to run az extension add --name azure-devops Indeed, as @roman_ka states, after deleting .azure directory (in...
Read more >
How do I resolve Access Denied error when trying to deploy ...
I tried to alter the dotnet version with the global.json. However when i run az webappyment source config-zip --resource-group ... i still get....
Read more >
Azure CLI task always fails with permission denied because it ...
Azure CLI task always fails with permission denied because it can't create a system defined directory - Visual Studio Feedback.
Read more >
Troubleshooting | LiveData Migrator for Azure
See Install the Azure CLI on Linux in the Microsoft documentation for ... az extension add --source ... If you do not, you...
Read more >
How to fix docker: Got permission denied while trying to ...
I've just installed docker but I have to run it with sudo every time. If I don't add sudo I get the following...
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