0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure CLI導入 - Azure - Memo

Last updated at Posted at 2023-11-19

(自分用メモ)
Azure関連コマンドラインインタフェース(CLI)の準備

az: リソース管理コマンド
func: Function管理用コマンド
azd: 開発用コマンド

環境

az: リソース管理コマンド

参考: https://learn.microsoft.com/ja-jp/cli/azure/install-azure-cli

ubuntuにインストールする例
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo -E bash
使用例: Azure Portalにログイン
az login

# リモート環境等ブラウザが使えない場合
az login --use-device-code 

# 加えてテナント(ディレクトリ)も指定する場合
# 事前にAzure Portal上で アカウント➜ディレクトリの切り替え➜ディレクトリID採取
az login --use-device-code --tenant xxxxxxx-112e-xxxxx-900b-xxxxxxxxxxx

昨今多要素認証要

func: Function管理用コマンド

使用例: Node.js用プロジェクト生成と関数func1を生成
func init . --worker-runtime node --language typescript
func new --template "Http Trigger" --name func1

azd: Azure Developer CLI(開発用コマンド)

導入
curl -fsSL https://aka.ms/install-azd.sh | sudo bash
お試しプロジェクト(--template todo-nodejs-mongo)のデプロイ
azd init --template todo-nodejs-mongo  # ローカルにテンプレプロジェクトを初期化
? Enter a new environment name: az241208-dev #アプリIDを入力

azd auth login --tenant-id xxxxxx-xxxxxxxx-xxxxxxxxxxxxx  # PortalでテナントIDを確認しておく
azd up # プロジェクトアップロード(対話的操作が必要)
? Subscription: Visual Studio Enterprise (xxxxx) など
? Location: West US など
結果
  (✓) Done: Deploying service web
  - Endpoint: https://app-web-wzy5txxxxxxxx.azurewebsites.net/
# SUCCESS: Your up workflow to provision and deploy to Azure completed in 13 minutes 58 seconds.

表示されたwebサービスのEndpointでWebアプリが実行されている。
image.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?