Azure CLI チートシート
Azure CLIコマンドのクイックリファレンス。VM、ストレージ、ID管理、Functions、AKS、ネットワーク、設定、SQLデータベースを網羅
61 件のコマンド
az vm create仮想マシンを作成
az vm create -g myRG -n myVM --image Ubuntu2204 --admin-username azureuser --generate-ssh-keysaz vm list仮想マシンの一覧を表示
az vm list -g myRG -o tableaz vm start仮想マシンを起動
az vm start -g myRG -n myVMaz vm stop仮想マシンを停止
az vm stop -g myRG -n myVMaz vm deallocate仮想マシンの割り当てを解除
az vm deallocate -g myRG -n myVMaz vm delete仮想マシンを削除
az vm delete -g myRG -n myVM --yesaz vm resize仮想マシンのサイズを変更
az vm resize -g myRG -n myVM --size Standard_DS3_v2az vm show仮想マシンの詳細を表示
az vm show -g myRG -n myVM -o jsonaz vm list-sizes利用可能なVMサイズを一覧表示
az vm list-sizes -l eastus -o tableaz vm open-portVMのポートを開放
az vm open-port -g myRG -n myVM --port 80az storage account createストレージアカウントを作成
az storage account create -n mystorageacct -g myRG -l eastus --sku Standard_LRSaz storage account listストレージアカウントの一覧を表示
az storage account list -g myRG -o tableaz storage account deleteストレージアカウントを削除
az storage account delete -n mystorageacct -g myRG --yesaz storage container createBlobコンテナを作成
az storage container create -n mycontainer --account-name mystorageacctaz storage blob uploadBlobをアップロード
az storage blob upload -f ./file.txt -c mycontainer -n file.txt --account-name mystorageacctaz storage blob listBlob一覧を表示
az storage blob list -c mycontainer --account-name mystorageacct -o tableaz storage blob downloadBlobをダウンロード
az storage blob download -c mycontainer -n file.txt -f ./downloaded.txt --account-name mystorageacctaz storage account show-connection-string接続文字列を表示
az storage account show-connection-string -n mystorageacct -g myRGaz ad user createAzure ADユーザーを作成
az ad user create --display-name 'John' --password Pa$$w0rd --user-principal-name john@contoso.comaz ad user listAzure ADユーザーを一覧表示
az ad user list -o tableaz ad sp create-for-rbacサービスプリンシパルを作成
az ad sp create-for-rbac --name myServicePrincipal --role contributor --scopes /subscriptions/{sub-id}az role assignment createロールを割り当て
az role assignment create --assignee user@contoso.com --role Reader --scope /subscriptions/{sub-id}az role assignment listロール割り当てを一覧表示
az role assignment list --assignee user@contoso.com -o tableaz ad group createAzure ADグループを作成
az ad group create --display-name DevTeam --mail-nickname devteamaz loginAzureにログイン
az loginaz functionapp createFunction Appを作成
az functionapp create -g myRG -n myFuncApp --storage-account mystorageacct --consumption-plan-location eastus --runtime nodeaz functionapp listFunction Appを一覧表示
az functionapp list -g myRG -o tableaz functionapp deleteFunction Appを削除
az functionapp delete -g myRG -n myFuncAppaz webapp createWeb Appを作成
az webapp create -g myRG -p myPlan -n myWebApp --runtime 'NODE:18-lts'az webapp listWeb Appを一覧表示
az webapp list -g myRG -o tableaz webapp deployWeb Appにデプロイ
az webapp deploy -g myRG -n myWebApp --src-path ./app.zip --type zipaz appservice plan createApp Serviceプランを作成
az appservice plan create -g myRG -n myPlan --sku B1 --is-linuxaz aks createAKSクラスターを作成
az aks create -g myRG -n myAKS --node-count 3 --generate-ssh-keysaz aks get-credentialsAKSクラスターの認証情報を取得
az aks get-credentials -g myRG -n myAKSaz aks listAKSクラスターを一覧表示
az aks list -o tableaz aks scaleAKSクラスターのノード数を変更
az aks scale -g myRG -n myAKS --node-count 5az aks deleteAKSクラスターを削除
az aks delete -g myRG -n myAKS --yesaz acr createコンテナレジストリを作成
az acr create -g myRG -n myACR --sku Basicaz acr loginコンテナレジストリにログイン
az acr login --name myACRaz network vnet create仮想ネットワークを作成
az network vnet create -g myRG -n myVNet --address-prefix 10.0.0.0/16az network vnet subnet createサブネットを作成
az network vnet subnet create -g myRG --vnet-name myVNet -n mySubnet --address-prefixes 10.0.1.0/24az network nsg createネットワークセキュリティグループを作成
az network nsg create -g myRG -n myNSGaz network nsg rule createNSGルールを作成
az network nsg rule create -g myRG --nsg-name myNSG -n AllowHTTP --priority 100 --destination-port-ranges 80 --access Allow --protocol Tcpaz network public-ip createパブリックIPを作成
az network public-ip create -g myRG -n myPublicIP --sku Standardaz network lb createロードバランサーを作成
az network lb create -g myRG -n myLB --sku Standard --frontend-ip-name myFrontEnd --backend-pool-name myBackEndaz network dns zone createDNSゾーンを作成
az network dns zone create -g myRG -n contoso.comaz group createリソースグループを作成
az group create -n myRG -l eastusaz group listリソースグループを一覧表示
az group list -o tableaz group deleteリソースグループを削除
az group delete -n myRG --yes --no-waitaz account listサブスクリプションを一覧表示
az account list -o tableaz account setアクティブなサブスクリプションを設定
az account set --subscription 'My Subscription'az configureAzure CLIの設定を管理
az configure --defaults group=myRG location=eastusaz resource listリソースを一覧表示
az resource list -g myRG -o tableaz tag createタグを作成
az tag create --resource-id /subscriptions/{sub-id}/resourceGroups/myRG --tags env=prodaz sql server createSQL Serverを作成
az sql server create -g myRG -n myserver -u sqladmin -p Pa$$w0rd -l eastusaz sql db createSQLデータベースを作成
az sql db create -g myRG -s myserver -n mydb --service-objective S0az sql db listSQLデータベースを一覧表示
az sql db list -g myRG -s myserver -o tableaz sql db deleteSQLデータベースを削除
az sql db delete -g myRG -s myserver -n mydb --yesaz sql server firewall-rule createファイアウォールルールを作成
az sql server firewall-rule create -g myRG -s myserver -n AllowMyIP --start-ip-address 203.0.113.1 --end-ip-address 203.0.113.1az cosmosdb createCosmos DBアカウントを作成
az cosmosdb create -g myRG -n mycosmosdbaz mysql server createMySQL Serverを作成
az mysql server create -g myRG -n mymysql -u mysqladmin -p Pa$$w0rd -l eastus --sku-name GP_Gen5_2