Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
573 views
in Technique[技术] by (71.8m points)

powershell - How to get status of all container pipeline in power shell?

I write script in powershell azure to get status pipeline.

  • Step 1: Using function Invoke-AzureRmDataFactoryV2Pipeline to run pipeline SPVB_YIELD_KPI.

  • Step 2: Using function Get-AzureRmDataFactoryV2PipelineRun to get status SPVB_YIELD_KPI.

It returns the status of only SPVB_YIELD_KPI.

How can I return all status containers in pipeline (example [Get Metadata], [ForEach],... in image)?

enter image description here

question from:https://stackoverflow.com/questions/65915603/how-to-get-status-of-all-container-pipeline-in-power-shell

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...