Logic Apps (Standard) の操作・管理のためのREST API

このエントリは2023/01/13現在の情報に基づいています。将来の機能追加や変更に伴い、記載内容からの乖離が発生する可能性があります。

問い合わせ内容

Logic Appsを使っていたいつもの問い合わせ主から、以下のような問い合わせがあった。

いまLogic Apps (Standard SKU) を使ってワークフロー (system workflow) を作成している。Logic AppsのREST APIを使って監視対象のLogic Appsの実行状況を確認したいのだが、どうもうまくいかない。どうしたらよいだろうか?

「いや、それREST APIドキュメントにあるでしょ」と思ってよく聞いてみると、以下のREST APIドキュメントを参照してAPI呼び出しを実行したものの、常に404を返してくるということだった。

Workflow Runs – Get
https://learn.microsoft.com/rest/api/logic/workflow-runs/get

「Logic Apps Standard SKUのREST APIは存在しないのだろうか?」というのが問い合わせ主の疑問。

何が問題だったのか?

上記のURLから参照できるREST APIはConsumption SKUを対象にしているが、Logic Apps Standard SKUはAzure Functionsベースであり、APIが異なることが原因。例えばWorkflow Runsの場合、ドキュメントは以下にあり

Workflow Runs – Get
https://learn.microsoft.com/rest/api/appservice/workflow-runs/get

これを見ると、Standard SKUのREST APIは

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostruntime/runtime/webhooks/workflow/api/management/workflows/{workflowName}/runs/{runName}?api-version=2022-03-01

対してConsumption SKU用REST APIのドキュメントは以下で

Workflow Runs – Get
https://learn.microsoft.com/rest/api/logic/workflow-runs/get

REST APIは

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}?api-version=2016-06-01

と、Path parameterおよびAPIバージョンが異なる。

Consumption SKUとStandard SKUのREST APIドキュメントを並べてみたところ、各SKUでドキュメントのURLも異なる。

  • Consumption SKU: https://learn.microsoft.com/rest/api/logic/ 配下にある
  • Standard SKU: https://learn.microsoft.com/rest/api/appservice/ 配下にある
CategoryConsumption SKUStandard SKU
Workflow Run Action Repetitionshttps://learn.microsoft.com/rest/api/logic/workflow-run-action-repetitionshttps://learn.microsoft.com/rest/api/appservice/workflow-run-action-repetitions
Workflow Run Action Repetitions Request Historieshttps://learn.microsoft.com/rest/api/logic/workflow-run-action-repetitions-request-historieshttps://learn.microsoft.com/rest/api/appservice/workflow-run-action-repetitions-request-histories
Workflow Run Action Scope Repetitionshttps://learn.microsoft.com/rest/api/logic/workflow-run-action-scope-repetitionshttps://learn.microsoft.com/rest/api/appservice/workflow-run-action-scope-repetitions
Workflow Run Actionshttps://learn.microsoft.com/rest/api/logic/workflow-run-actionshttps://learn.microsoft.com/rest/api/appservice/workflow-run-actions
Workflow Runhttps://learn.microsoft.com/rest/api/logic/workflow-runshttps://learn.microsoft.com/rest/api/appservice/workflow-runs
Workflow Trigger Historieshttps://learn.microsoft.com/rest/api/logic/workflow-trigger-historieshttps://learn.microsoft.com/rest/api/appservice/workflow-trigger-histories
Workflow Triggershttps://learn.microsoft.com/rest/api/logic/workflow-triggershttps://learn.microsoft.com/rest/api/appservice/workflow-triggers
Workflow Versionshttps://learn.microsoft.com/rest/api/logic/workflow-versionshttps://learn.microsoft.com/rest/api/appservice/workflow-versions
Workflowshttps://learn.microsoft.com/rest/api/logic/workflowshttps://learn.microsoft.com/rest/api/appservice/workflows

注意点

Workflowに関するREST APIは別だが、EDI関連のAPIはConsumption SKUと同じなので注意が必要。

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中