2016年8月4日木曜日

PowerShellでAzureを操作するときのLocation

PowerShellでAzureを操作するときのLocationですが、いつも使う以外のLocationは忘れがちなので取得方法を書いておきます。

MSDNにはGet-AzureRmLocationコマンドレッドについての記述がありますが、2016年8月現在で使用できないようです。ですので、Get-AzureRmResourceProviderコマンドレッドを使いましょう。
(Get-AzureRmResourceProvider).Locations | Sort-Object | Get-Unique -AsString

結果は以下のようにでます。
Australia East
Australia Southeast
Brazil South
Canada Central
Canada East
Central India
Central US
Central US (Stage)
East Asia
East Asia (Stage)
East US
East US 2
East US 2 (Stage)
Global
global
Japan East
Japan West
MSFT East Asia
MSFT East US
MSFT North Europe
MSFT West US
North Central US
North Central US (Stage)
North Europe
South Central US
South India
Southeast Asia
West Central US
West Europe
West India
West US
West US 2

ちょっと余計なものも出ているような気がしますが。