If you want to get the running detailsof every activity in one pipeline, we can use the PowerShell command Get-AzDataFactoryV2ActivityRun
. For more details, please refer to here
For example
#Invoke a pipeline
$RunId = Invoke-AzDataFactoryV2Pipeline `
-DataFactoryName "<DataFactoryName>" `
-ResourceGroupName "<ResourceGroupName>" `
-PipelineName "<pipeLineName>"
# check pipeline status
while ($True) {
$Run = Get-AzDataFactoryV2PipelineRun `
-ResourceGroupName "<DataFactoryName>" `
-DataFactoryName "<pipeLineName>" `
-PipelineRunId $RunId
if ($Run) {
if ($run.Status -ne 'InProgress') {
Write-Output ("Pipeline run finished. The status is: " + $Run.Status)
$Run
break
}
Write-Output "Pipeline is running...status: InProgress"
}
Start-Sleep -Seconds 10
}
# get the running details of every activity in the pipeline
Get-AzDataFactoryV2ActivityRun `
-ResourceGroupName "<DataFactoryName>" `
-DataFactoryName "<pipeLineName>" `
-PipelineRunId $RunId `
-RunStartedAfter (Get-Date).AddMinutes(-30) -RunStartedBefore (Get-Date).AddMinutes(30)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…