ADF REST API用于活动运行不返回数据

huangapple go评论64阅读模式
英文:

ADF REST API for Activity Runs not returning data

问题

我正在从父管道调用Activity Runs Rest API以捕获子管道中的任何错误。

然而,Value 数组中没有返回任何数据,无论是什么类型。

以下是我的设置。

Web 活动

URL

https://management.azure.com/subscriptions/@{pipeline().globalParameters.SubscriptionId}/resourceGroups/@{pipeline().globalParameters.ResourceGrpName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{pipeline().RunId}/queryActivityRuns?api-version=2018-06-01

Body

{   "lastUpdatedAfter": "2023-05-23T00:00:00.3345758Z",  
"lastUpdatedBefore": "2023-05-30T00:00:00.3686473Z" }

我在子管道中设置了一个活动以失败。

这是响应 - Value 数组中没有内容

{
	"value": [],
	"ADFWebActivityResponseHeaders": {
		"Pragma": "no-cache",
		"x-ms-correlation-request-id": "94cxxxx0-xxxx-xxxx-xxxx-b0842c922b3f",
...
	},
	"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West Europe)",
	"executionDuration": 0,
	"durationInQueue": {
		"integrationRuntimeQueue": 0
	},
	"billingReference": {
		"activityType": "ExternalActivity",
		"billableDuration": [
			{
				"meterType": "AzureIR",
				"duration": 0.016666666666666666,
				"unit": "Hours"
			}
		]
	}
}

我尝试过在 URL 中使用父管道的 RunId 和子管道的 RunId,都返回空的 Value 数组。

我漏掉了什么?

英文:

I'm calling the Activity Runs Rest API from a parent pipeline to capture any errors in a child pipeline.

However, no data, of any kind, is being returned in the Value array.

Here are my settings.

ADF REST API用于活动运行不返回数据

Web activity

ADF REST API用于活动运行不返回数据

URL

> https://management.azure.com/subscriptions/@{pipeline().globalParameters.SubscriptionId}/resourceGroups/@{pipeline().globalParameters.ResourceGrpName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{pipeline().RunId}/queryActivityRuns?api-version=2018-06-01

Body

{   "lastUpdatedAfter": "2023-05-23T00:00:00.3345758Z",  
"lastUpdatedBefore": "2023-05-30T00:00:00.3686473Z" }

ADF REST API用于活动运行不返回数据

I've set an activity in the child pipeline to fail.

This is the response - nothing in the Value array

    {
    	"value": [],
    	"ADFWebActivityResponseHeaders": {
    		"Pragma": "no-cache",
    		"x-ms-correlation-request-id": "94cxxxx0-xxxx-xxxx-xxxx-b0842c922b3f",
...
    	},
    	"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West Europe)",
    	"executionDuration": 0,
    	"durationInQueue": {
    		"integrationRuntimeQueue": 0
    	},
    	"billingReference": {
    		"activityType": "ExternalActivity",
    		"billableDuration": [
    			{
    				"meterType": "AzureIR",
    				"duration": 0.016666666666666666,
    				"unit": "Hours"
    			}
    		]
    	}
    }

I've tried both the parent pipeline runid and the child pipeline runid in the URL and both return an empty Value array.

What am I missing?

答案1

得分: 1

你需要确保要捕获执行详细信息的流水线是通过“触发”模式而不是“调试”模式执行的。因此,您需要发布和触发该流水线,捕获流水线运行 ID,并将其传递给 Web 活动。

英文:

You need to make sure that the pipeline whose execution details you want to capture is executed via 'Trigger' mode and not 'Debug' mode. So , you need to publish and trigger the pipeline, capture the pipeline runid and pass the same in the web activity.

答案2

得分: 1

以下是翻译好的部分:

已同意与 @AnnuKumari 达成协议,要获取活动运行详情,管道应以触发器方式运行,而不是调试模式,遇到了相同的问题,但当我触发它时,我获得了一个输出。还请确保这是正确的,并且运行存在于指定的时间间隔内(UTC)。

此外,由于您想要获取子管道活动的活动运行详情,您需要提供其运行 ID,如 @{activity('Execute Pipeline1').output.pipelineRunId}

示例 URL:
https://management.azure.com/subscriptions/@{pipeline().globalParameters.SubscriptionId}/resourceGroups/@{pipeline().globalParameters.ResourceGrpName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{activity('Execute Pipeline1').output.pipelineRunId}/queryActivityRuns?api-version=2018-06-01

我的执行:

ADF REST API用于活动运行不返回数据

输出:

ADF REST API用于活动运行不返回数据

英文:

Agreed with @AnnuKumari to get activity run details the pipeline should be run with trigger does not debug mode faced same issue but when I triggered it I got an output. Also make sure that is right one and runs exist between the interval specified (UTC).

Also, as you want the activity run details of child pipeline activity. you need to provide its run id as @{activity('Execute Pipeline1').output.pipelineRunId}

Sample URL:

https://management.azure.com/subscriptions/@{pipeline().globalParameters.SubscriptionId}/resourceGroups/@{pipeline().globalParameters.ResourceGrpName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{activity('Execute Pipeline1').output.pipelineRunId}/queryActivityRuns?api-version=2018-06-01

My execution:

ADF REST API用于活动运行不返回数据

Output:

ADF REST API用于活动运行不返回数据

huangapple
  • 本文由 发表于 2023年5月25日 17:36:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76330862.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定