Windows PowerShell を起動します。"管理者として実行する"を選択すると、azコマンドが認識しません。通常の起動を行います。
PS C:\Users\Administrator> az --version
az : 用語 'az' は、コマンドレット、関数、スクリプト ファイル、または操作可能なプログラムの名前として認識されません。名
前が正しく記述されていることを確認し、パスが含まれている場合はそのパスが正しいことを確認してから、再試行してください。
発生場所 行:1 文字:1
+ az --version
+ ~~
+ CategoryInfo : ObjectNotFound: (az:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Windows PowerShellが起動後、azコマンドが使えることを確認します。
PS C:\Users\Administrator> az --version
azure-cli 2.12.1 *
core 2.12.1 *
telemetry 1.0.6
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\Administrator\.azure\cliextensions'
Python (Windows) 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
You have 2 updates available. Consider updating your CLI installation with 'az upgrade'
Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
az login コマンドを実行します。ブラウザが起動するので、Microsoft アカウントでログインします。
PS C:\Users\Administrator> az login
You have logged in. Now let us find all the subscriptions to which you have access...
PS C:\Windows\system32> az login
ValidationError: Certificate verification failed. This typically happens when using Azure CLI behind a proxy that intercepts traffic with a self-signed certificate. Please add this certificate to the trusted CA bundle. More info: https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#work-behind-a-proxy.
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Set-Location Env:
PS Env:\> [Environment]::SetEnvironmentVariable("AZURE_CLI_DISABLE_CONNECTION_VERIFICATION","1")
PS Env:\> Get-ChildItem AZURE*
Name Value
---- -----
AZURE_CLI_DISABLE_CONNECTIO... 1
PS Env:\>
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Set-Location Env:
PS Env:\> Get-ChildItem AZURE*
Name Value
---- -----
AZURE_CLI_DISABLE_CONNECTIO... 1
PS Env:\>