Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
clean azure subscription
Search
kongou-ae
September 09, 2017
Technology
0
1k
clean azure subscription
JAZUG 7周年総会のLTで発表したスライドです。
kongou-ae
September 09, 2017
Tweet
Share
More Decks by kongou-ae
See All by kongou-ae
Azure Arc で Azure Stack HCI 上の仮想マシンを操作する / operate-virtual-machine-on-AzsHCI-by-Arc
kongou_ae
0
320
Windows Update を NSG で許可する / Permit the traffic of windows update by NSG
kongou_ae
0
1.6k
Azure Stack HCI に 21H2 機能更新を適用した時の苦労話 / trouble about applying 21h2 update to Azure Stack HCI OS
kongou_ae
0
460
2020年の Azure Stack Hub を振り返る / review-of-Azure-Stack-Hub-in-2020
kongou_ae
0
480
NSG フローログを確認する方法 / how-to-confirm-nsg-flow-log
kongou_ae
1
2.3k
仮想アプライアンス担当者向け Azure ネットワーク/azure network that focus on network virtual appliance
kongou_ae
2
2.5k
Azure のサービスを利用して Windows Server を運用管理する / operation and management of windows server by Azure service
kongou_ae
0
610
Azure Stack Edge を導入した話 / The story about installing Azure Stack Edge
kongou_ae
0
610
Azure Stack Hub を導入して分かった10のこと / 10 things I learned after installing Azure Stack Hub
kongou_ae
0
1.7k
Other Decks in Technology
See All in Technology
Why do you get AWS certificates
hirosys
0
120
オブジェクト指向CSSが叶えたかったことと、CSSのいま / The aims of Object-oriented CSS and the current state of CSS usage
shinkufencer
11
3.7k
こんなに簡単!AWSマルチアカウント
takuya_terada
0
120
Introducing Pkl
enomotok
0
330
あらゆる商品を扱う商品データベースを再設計した話 / product db re-architecture
rince
8
3.9k
イチから学ぶdbt / Learn dbt from scratch
shinyaa31
0
160
Code Smells @Voxxed Bucharest 24
victorrentea
2
270
生成AIの不確実性と向き合うためのオブジェクト指向設計
tkikuchi1002
2
700
プッシュ型子育てサービスを、先行プロジェクト実施自治体において開始します
govtechtokyo
0
300
Terraform v1.7のTest mocking機能の紹介 / Introducing the Test mocking feature of Terraform v1.7
yayoi_dd
1
100
Evolutionary Optimization of Model Merging Recipes
fuyu_quant0
3
560
技術広報経験0のEMがエンジニアブランディングをはじめてみた
coconala_engineer
1
140
Featured
See All Featured
The Invisible Side of Design
smashingmag
293
49k
Web Components: a chance to create the future
zenorocha
304
41k
How STYLIGHT went responsive
nonsquared
92
4.7k
4 Signs Your Business is Dying
shpigford
174
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
67
38k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
The World Runs on Bad Software
bkeepers
PRO
60
6.6k
The Invisible Customer
myddelton
114
12k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
How To Stay Up To Date on Web Technology
chriscoyier
781
250k
The Art of Programming - Codeland 2020
erikaheidi
40
12k
Transcript
サブスクリプションを掃除する @kongou_ae
自己紹介 • @kongou_ae • ネットワークエンジニアからクラウドエンジニアに社内 転職 • SIerでAzureとAzure Stackなう
課題 • 検証環境のサブスクリプションが汚い
汚いサブスクリプションとは • 未割当のリソースが大量に残っている
汚れの原因 • VMを消しても関連リソースが消えない – 気軽にVMを作る→VMだけ消す→地獄絵図 VM削除前 VM削除後
そうだ、掃除しよう
もっとも簡単な掃除の仕方 • リソースグループごと消す – リソースグループ内のリソースがきれいさっぱり全部消える – 1つのリソースグループに「いるもの」と「いらないもの」を 入れると掃除地獄が始まる
GUIで掃除する • 「全てのリソース」ではリソースを消せない
GUIで掃除する • 一括操作できるようになります。でも、ポチポチ大変。
せめてCLIで • 未使用Network Interfaceを一括削除 az network nic delete --ids $(az
network nic list –query "[?virtualMachine==null]|[?networkSecurityGroup==null].id" -o tsv) • 未使用Public IP Addressを一括削除 az network public-ip delete --ids $(az network public-ip list -- query "[?ipConfiguration==null].id" -o tsv)
せめてCLIで • 問答無用で消えちゃいませんか? – 消えます – 必要なリソースであればロックする
コマンドを何度も叩くのが面倒 • azClean.shを作った – https://github.com/kongou-ae/azureRM-resource- cleaner – コマンド1発で次の未使用リソースをお掃除します • Public
IP Address • Network Interface • Managed Disk • Network Security Group – Cloud Shellで実行するのお勧め(認証的な意味で
お勧めの掃除方法を教えてください!