This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This PowerShell script triggers and monitors an Azure data factory pipeline outcome. | |
[CmdletBinding()] | |
param( | |
$resourceGroupName, | |
$dataFactoryName, | |
$DFPipelineName | |
) | |
$RunId = Invoke-AzDataFactoryV2Pipeline ` | |
-DataFactoryName $DataFactoryName ` | |
-ResourceGroupName $ResourceGroupName ` | |
-PipelineName $DFPipeLineName | |
while ($True) { | |
$Run = Get-AzDataFactoryV2PipelineRun ` | |
-ResourceGroupName $ResourceGroupName ` | |
-DataFactoryName $DataFactoryName ` | |
-PipelineRunId $RunId | |
if ($Run) { | |
if ($run.Status -eq 'Succeeded') { | |
Write-Output ("Pipeline run finished. The status is: " + $Run.Status) | |
$Run | |
break | |
} | |
if ($run.Status -eq 'Failed') { | |
Write-Error ("Pipeline run failed. " + $Run.Message ) | |
$Run | |
break | |
} | |
Write-Output ("Pipeline is running...status: " + $Run.Status) | |
} | |
Start-Sleep -Seconds 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment