LoginSignup
0
1

More than 3 years have passed since last update.

AzureのデータセンターのIPの取り方

Posted at

まずこちらの記事をお読みください。
Azure データセンターの IP 範囲 (XML ファイル) は 2020 年 6 月 30 日までに廃止予定

深淵なる理由で、AzureのDataCenterのIP Rangeを欲しくなることがあります。

今まではMicrosoft Azure Datacenter IP RangesからXMLをGetしていたと思いますが、これが2020年6月30日に廃止予定となりました。

代わりにService Tagsの一覧を得るRest APIがあるので、これを使う事が出来ます。

Azure CLIからも利用可能で、例えば東日本のデータセンターのIPの一覧は以下のようにして取れます。

az network list-service-tags --location japaneast | python -c "import sys,json; d=json.load(sys.stdin); print(json.dumps([x for x in d['values'] if x['id']=='AzureCloud.japaneast'][0], indent=2))"
{
  "id": "AzureCloud.japaneast",
  "name": "AzureCloud.japaneast",
  "properties": {
    "addressPrefixes": [
      "13.71.128.0/19",
      "13.73.0.0/19",
      "13.78.0.0/17",
      "20.37.96.0/19",
      "20.38.116.0/23",
      "20.40.88.0/21",
      "20.40.96.0/21",
      ...
    ],
    "changeNumber": "17",
    "region": "japaneast",
    "systemService": ""
  }
}

上記は東日本のデータセンター全てでしたが、Service Tagの単位で管理されているようなので、例えば全てのAppService、東日本のAppServiceのIP Rangeといったレベルでも取れます。

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