2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WindowsでAzure CLIとAzure Developer CLIを使えるようにする

Last updated at Posted at 2023-04-23

はじめに

今まではAzureリソースの操作はAzureポータル上で済ませることが多かったですが、CLIでも操作する必要が出てきたので、備忘録としてWindowsでAzure CLIAzure Developer CLIの使用方法について簡単にまとめました。

Azure Cloud Shell で Azure CLIを使用

WindowsではありませんがAzure CLIを使用するだけなら、azure portalでブラウザー上で実行するのが最も簡単です。ポータル右上に並ぶ一番右のアイコンを選択すると、Azure Cloud Shellがブラウザーの下部に表示されます。
image.png
ストレージがマウントされていない場合は、ストレージを作成するサブスクリプションを選択した後に、「ストレージの作成」を押す必要があります。
image.png

PowerShell で Azure CLIを使用

WindowsでAzure CLIを使用するために、マイクロソフトインストーラー(MSI)を使ってインストールすることができますが、Windowsパッケージマネージャー(winget)を使ってインストールすることもできます。今回はwingetAzure CLIをインストールしました。まず、wingetが入っているかを確認します。

Powershell
winget --version

実際にAzure CLIをインストールします。

Powershell
winget install -e --id Microsoft.AzureCLI

Azure CLIがインストールされています。
スクリーンショット 2023-04-23.png
インストール中はダイアログボックスが表示されるので、1,2分程待ちます。
スクリーンショット 2023-04-23 113521.png
インストールが完了し、ダイアログが消えたらPowerShellを起動し直して、Azure CLIのバージョンを確認します。

PowerShell
az --version

バージョンが正しく表示されれば、Azure CLIのインストールは成功です。
スクリーンショット 2023-04-23 113936.png

PowerShell で Azure Developer CLIを利用

PowerShellで以下のコマンドを実行することで、azdコマンドが利用できるようになります。

Powershell
winget install microsoft.azd

詳細は以下の公式ドキュメントをご覧ください。

おわりに

wingetを使って簡単にAzure CLIAzure Developer CLIをインストールすることができました。Azureポータルも便利ですが、今後は折角なのでAzure CLIAzure Developer CLIも使えるようにしたいです。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?