WSL2(Ubuntu22.04)にAzure CLIをインストールする

WSL2(Ubuntu22.04)にAzure CLIをインストールする

インストール

Azure CLI を Linux にインストールする
Azure CLI を Linux 上に手動でインストールして実行する方法について説明します。 Linux コンピューターへの Azure CLI のインストールは、1 つのコマンドで行うことも、ステップ バイ ステップ プロセスに従って行...

ドキュメントにあるコマンドを実行します。

$ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

azコマンドが実行できるようになります。

$ az --version
azure-cli                         2.48.1

core                              2.48.1
telemetry                          1.0.8

Dependencies:
msal                              1.20.0
azure-mgmt-resource               22.0.0

Python location '/opt/az/bin/python3'
Extensions directory '/home/takahashi-h5/.azure/cliextensions'

Python (Linux) 3.10.10 (main, Apr 25 2023, 04:23:10) [GCC 11.3.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

.azure

ユーザのホームディレクトリに.auzreディレクトリが作成されます。

中身は以下になります。

$ ls -la
total 48
drwxr-xr-x 4 takahashi-h5 takahashi-h5 4096 May 17 18:02 .
drwxr-x--- 3 takahashi-h5 takahashi-h5 4096 May 17 18:02 ..
-rw-r--r-- 1 takahashi-h5 takahashi-h5    5 May 17 18:02 az.json
-rw-r--r-- 1 takahashi-h5 takahashi-h5    5 May 17 18:02 az.sess
-rw-r--r-- 1 takahashi-h5 takahashi-h5   67 May 17 18:02 az_survey.json
-rw-r--r-- 1 takahashi-h5 takahashi-h5   61 May 17 18:02 azureProfile.json
-rw-r--r-- 1 takahashi-h5 takahashi-h5    5 May 17 18:02 commandIndex.json
-rw------- 1 takahashi-h5 takahashi-h5   27 May 17 18:02 config
drwxr-xr-x 2 takahashi-h5 takahashi-h5 4096 May 17 18:02 logs
drwxr-xr-x 2 takahashi-h5 takahashi-h5 4096 May 17 18:02 telemetry
-rw-r--r-- 1 takahashi-h5 takahashi-h5   19 May 17 18:02 telemetry.txt
-rw-r--r-- 1 takahashi-h5 takahashi-h5  211 May 17 18:02 versionCheck.json

アンインストール

以下コマンドでアンインストールすることができます。

$ sudo apt remove -y azure-cli

コメント

タイトルとURLをコピーしました