首页 > 解决方案 > 如何获取与 Azure SDK 运行的 Azure LogicApp 相关的所有操作?

问题描述

我有一个包含 100 多个操作的逻辑应用程序。我正在使用以下代码来获取逻辑应用运行的所有操作和状态,

        return _client
            .WorkflowRunActions
            .ListWithHttpMessagesAsync(_resourceGroup, logicApp, workflowRunName)
            .Result.Body.OrderBy(x => x.StartTime);

但它只返回 30,而不是所有动作。在我的逻辑应用程序中,我有一些操作可以将记录插入 Azure Sql 表,例如, 在此处输入图像描述

但是上面的代码没有返回这些动作。我还注意到条件下的所有操作也没有返回。任何人都可以分享一些想法吗?

标签: azureazure-logic-apps

解决方案


在 Result Body 中有一个NextPageLink属性,用于获取下一个响应页面。你可以参考我下面的代码。

            Task<AzureOperationResponse<IPage<WorkflowRunAction>>> actions = client.WorkflowRunActions.ListWithHttpMessagesAsync(resourceGroupName: "resource group name", workflowName: "gelogic", runName: "run name");

            var nextaction = client.WorkflowRunActions.ListNextWithHttpMessagesAsync(actions.Result.Body.NextPageLink);

            var numerator = nextaction.Result.Body.GetEnumerator();

            while (numerator.MoveNext()) {
                WorkflowRunAction item = numerator.Current;
                Console.WriteLine(item.Name);
            }

在此处输入图像描述


推荐阅读