0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

新しい Azure サービスが使えるリージョンを Azure CLI で調べてみた

Posted at

背景と目的

Azure Web PubSub サービスという新しい Azure サービスがパブリックプレビューになったとの事で、どのリージョンで使用出来るのかとても気になります。

リージョン別の利用可能な製品というサイトで調べる事は出来るのですが、Azure CLI で調べる方法を調べてみたくなり、その結果を残しておきます。

前提条件

コマンドの実施環境は、Mac + Azure CLI です。

Azure Web PubSub の CLI を利用するためには、2.22.0 以上にする必要があります。

zsh
% sw_vers
ProductName:    macOS
ProductVersion: 11.3
BuildVersion:   20E232

% az version                            
{
  "azure-cli": "2.22.1",
  "azure-cli-core": "2.22.1",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {}
}

実施内容

事前にリージョン別の利用可能な製品というサイトで東日本リージョンは利用出来ない事が分かっているので、検証する為にあえて東日本リージョンを選択しています。

zsh
# webpubsub を有効にします
% az extension add \
  --name webpubsub
The installed extension 'webpubsub' is in preview.

# リソースグループを作ります
az group create \
  --name webpubsub-rg \
  --location japaneast

# あえて東日本リージョンで webpubsub を作ります
az webpubsub create \
  --name webpubsubtest \
  --resource-group webpubsub-rg \
  --location japaneast \
  --sku Free_F1
(LocationNotAvailableForResourceType) The provided location 'japaneast' is not available for resource type 'Microsoft.SignalRService/WebPubSub'. List of available regions for the resource type is 'eastus,northeurope,southeastasia,westeurope,westus2'.

利用可能なリージョンは、eastus,northeurope,southeastasia,westeurope,westus2 だと教えてくれます。

また、リソースタイプが Microsoft.SignalRService/WebPubSub であることも分かります。

実施結果

上記のように適当なリージョンでリソースを作成してみるのも良いのですが、リソース作成前に利用可能なリージョンを調べたいので、リソースプロバイダーの情報を調べてみます。

zsh
# WebPubSub がリソースプロバイダーにあるのか調べます
% az provider list | grep -i webpubsub
        "resourceType": "WebPubSub"

# リソースタイプに WebPubSub がある namespace を調べます
% az provider list \
  --query "[?resourceTypes[?resourceType=='WebPubSub']].namespace"
[
  "Microsoft.SignalRService"
]

# リソースプロバイダーの情報からロケーションを表示します
% az provider show \
  --namespace Microsoft.SignalRService \
  --query "resourceTypes[?resourceType=='WebPubSub'].locations[]" \
  --output tsv
East US
North Europe
Southeast Asia
West Europe
West US 2

# ロケーション名からリージョン名を調べます
% az account list-locations \
  --query "[?displayName=='Southeast Asia']" \
  --output table
Name           DisplayName     RegionalDisplayName
-------------  --------------  -----------------------------
southeastasia  Southeast Asia  (Asia Pacific) Southeast Asia

参考

Microsoft Azure Web PubSub service now in public preview

az webpubsub create

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?