You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Data Factory调用API仅返回前100条管道运行记录问题

解决Azure Data Factory管道运行记录仅返回100条的问题

问题根源在于Azure Data Factory的管道运行查询API默认单页返回100条数据,虽然你使用了AsyncPageable处理自动分页,但未调整默认分页大小限制,导致单页数据量被卡在上限。

解决方案

修改调用GetPipelineRunsAsync的代码,显式指定maxPageSize参数以增大单页返回数据量,AsyncPageable会自动遍历所有分页数据:

ResourceIdentifier dataFactoryResourceId = DataFactoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, factoryName);
DataFactoryResource dataFactory = _armClient.GetDataFactoryResource(dataFactoryResourceId);     

RunFilterContent content = new RunFilterContent(DateTimeOffset.UtcNow.AddDays(-1).AddHours(-1), DateTimeOffset.MaxValue);
content.OrderBy.Add(new RunQueryOrderBy(RunQueryOrderByField.RunStart, RunQueryOrder.Desc));

List<FactoryPipelineRunInfo> runs = new List<FactoryPipelineRunInfo>();
// 指定单页返回1000条数据,AsyncPageable会自动拉取后续分页
await foreach (FactoryPipelineRunInfo item in dataFactory.GetPipelineRunsAsync(content, maxPageSize: 1000))
{
    runs.Add(item);
}

额外检查点

  • 确认时间范围是否准确:DateTimeOffset.UtcNow.AddDays(-1).AddHours(-1)是否覆盖了你需要的全部运行记录,避免因时间过滤导致数据不足。
  • 若总数据量超过设置的maxPageSize,AsyncPageable会自动发起后续请求获取剩余数据,无需手动处理分页标记。

内容的提问来源于stack exchange,提问作者spectacularbob

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 10:33:13