Operations & Troubleshooting参照資料確認: 2026-09-11

Azure CLI Network Cheat Sheet

Azure networking incidentで最初に使うread-only Azure CLIをresource inventory、effective route/security、next hop、IP flow、connectivity、DNS関連に分けて整理する。

Scope: Microsoft Learn / Azure Architecture Centerの一次資料を2026-09-11時点で確認し、旧来の短い記事を公開運用向けdeep diveへ更新。SKU、region、limits、Preview statusは変わるため、実装直前にOfficial sourcesを再確認してください。

Azure CLI Network Cheat Sheetを理解するための前提

CLI commandはsubscription/resource group/resource IDを明示し、incident中のwrong-contextを防ぐ。 NIC effective route/securityは設定値より実効状態を確認するための最重要read-only evidence。

Network Watcher show-next-hop/test-ip-flowはrouteとNSG decisionを個別に証明できる。 test-connectivityはsource resourceからdestination endpointへのconnection testに使えるがCLI上はPreview statusのためsupport levelを認識する。

show-topologyはresource relationship inventoryに使えるがResource Graph反映遅延を考慮する。 outputはtableだけでなくJSONを保存しbefore/after diffへ使う。

通信や判断の流れを追う
症状を再現設定を確認能動試験ログ / packetアプリ確認

Control plane と data plane

Control planeCLIはAzure Resource Manager/Network Watcher APIをreadし、resource configuration/effective stateを取得する。
Data plane多くのcommandはpacketを生成しない。test-connectivity/test-ip-flow等もtool固有simulation/diagnosticでありapplication successとは区別する。

仕組みと設計上の意味

最初にaz account showでsubscriptionを固定する。

incident evidenceはcommand、timestamp、resource ID、outputをセットで保存する。

JMesPath --queryは便利だが初動ではfieldを落としすぎずraw JSONも保持する。

mutation command(create/update/delete)とread-only command(show/list/test)をrunbookで分離する。

Packet / decision path

source→destinationを1本のflowとして固定し、名前解決・routing・security・NAT/service processing・return pathを必要な範囲で順に確認する。

  1. context確認。
  2. resource inventory。
  3. effective route/security。
  4. Network Watcher diagnostic。
  5. application/runtime evidenceと突合。

設計判断

判断点推奨理由
Inventoryshow/listresource stateを取得
Routingshow-effective-route-table / show-next-hopwinning route確認
Securitylist-effective-nsg / test-ip-flowNSG decision確認
Connectivitytest-connectivityend-to-end diagnostic補助

確認手順

Azure Portal

  • Cloud Shell/terminalでaz account showを最初に実行。
  • 対象resource IDをPortalからコピーしcommand typoを防ぐ。
  • output JSONをincident folderへ保存。

Evidence contract

Identitysubscription / resource group / resource ID / regionを固定。
Before / After同じsource・destination・protocol・portで比較。
Effective state設定値だけでなくeffective route/security/health/logを取得。
Runtimecontrol-plane Succeededとapplication successを分けて判定。
Azure CLI — read-only first
az account show -o table
az network nic show-effective-route-table -g <rg> -n <nic> -o table
az network nic list-effective-nsg -g <rg> -n <nic> -o jsonc
az network watcher show-next-hop -g <rg> --vm <vm> --source-ip <src> --dest-ip <dst> -o jsonc
az network watcher test-ip-flow -g <rg> --vm <vm> --direction Outbound --protocol TCP --local <src:port> --remote <dst:port>
az network watcher test-connectivity -g <rg> --source-resource <vm-or-id> --dest-address <fqdn-or-ip> --dest-port <port>
az network watcher show-topology -g <rg> -o jsonc
az network route-table route list -g <rg> --route-table-name <rt> -o table

障害切り分け

症状疑う点証拠次の確認
ResourceNotFoundsubscription/RG/name誤りaz account show + resource IDcontext修正
command unavailableCLI version/extension差az version/helpcurrent CLI docs確認
empty effective routeresource state/permission/target mismatchNIC/provisioning/RBACtarget見直し
tool PASSだがapp失敗application/DNS/TLS/NVA layerapp/log evidencetool scope外へ進む

変更・rollback

  • incident中にupdate/create/delete commandを混ぜない。
  • CLI versionとextensionsをevidenceに残す。
  • script化する場合set -e相当だけでなくread-only contractをreview。
  • 検証後もraw JSONを保存し、table出力だけに依存しない。

Official sources