😀

Azure Logic Apps 従量課金を Azure CLI を使ってゾーン冗長で作成してみた

に公開

Azure Logic Apps の従量課金をゾーン冗長で作成するのはプレビュー中という事もあり、今のところ Azure ポータルからのみサポートさています。つまり Azure CLI からの作成はまだサポートされていないわけですが、Azure ポータルも一つのウェブアプリケーションなので、最終的な処理は Azure REST API で Azure リソースを作成しているはずです。そこで今回は Azure CLI の REST 機能を使って、プレビュー中のゾーン冗長設定の Azure Logic Apps を作成してみました。

まずは Azure ポータルでゾーン冗長で作成して JSON を確認

ゾーン冗長の場合は、"zoneRedundancy": "Enabled" が存在するようです。

logicapp-zone-01.png

logicapp-zone-02.png

Azure CLI でゾーン冗長の Azure Logic Apps を作成

bash
wf=mnrlgama-003
rg=mnrlgama-rg
sid=$(az account show --query id --output tsv)
location=japaneast

az rest \
  --method put \
  --url "https://management.azure.com/subscriptions/$sid/resourceGroups/$rg/providers/Microsoft.Logic/workflows/$wf?api-version=2016-06-01" \
  --body '{
  "properties": {
    "definition": {
      "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {},
      "triggers": {},
      "actions": {},
      "outputs": {}
    },
    "parameters": {},
    "zoneRedundancy": "Enabled"
  },
  "location": "'$location'",
  "tags": {}
}'

参考

https://learn.microsoft.com/ja-jp/azure/logic-apps/set-up-zone-redundancy-availability-zones?tabs=consumption

https://learn.microsoft.com/ja-jp/rest/api/logic/workflows/create-or-update?tabs=HTTP

Discussion