权限被拒绝的异常Azure CLI

时间:2020-08-21 15:07:14

标签: azure azure-cli

我刚刚安装了Azure CLI,并尝试运行az --version。文件az.sess获得权限被拒绝的例外情况

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

尝试以管理员身份运行Power Shell,并确保CLI安装不是只读的

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'

0 个答案:

没有答案