LoginSignup
0
1

More than 5 years have passed since last update.

azure 仮想マシン シャットダウン 課金を防ぐための確認方法

Posted at

メモ代わりに書いています。Azureの停止しているつもりが課金状態だったということがあったので、人はミスをするものという考え方で確認する方法をまとめてみました。
月、週に1回程度回したほうがいいのかなと思って探してみたのですが、リソースグループを指定する方法しかなかったので
Azureのサブスクリプション毎の仮想マシンの状態確認方法をまとめました。

止まっている仮想マシン一覧

Azureで課金状態になってしまう仮想マシン名を出力します。これがしたくて調べました。
az vm list -d --query "[?powerState=='VM stopped'].{name:name}" --out table

完全停止し、課金対象ではない仮想マシン一覧

まあ、確認用ですね。
az vm list -d --query "[?powerState=='VM deallocated'].{name:name}" --out table

稼働中の仮想マシン一覧

停止している仮想マシンが無い時の確認用です。
az vm list -d --query "[?powerState=='VM running '].{name:name}" --out table

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