コード例 #1
0
        public override PipelineRunStatus ExecutePipeline(PipelineRequest request)
        {
            if (request.PipelineParameters == null)
            {
                _logger.LogInformation("Calling pipeline without parameters.");
            }
            else
            {
                _logger.LogInformation("Calling pipeline with parameters.");
            }

            CreateRunResponse runResponse;

            runResponse = _pipelineClient.CreatePipelineRun
                          (
                request.PipelineName,
                parameters: request.ParametersAsObjects
                          );

            _logger.LogInformation("Pipeline run ID: " + runResponse.RunId);

            //Wait and check for pipeline to start...
            PipelineRun pipelineRun;

            _logger.LogInformation("Checking ADF pipeline status.");
            while (true)
            {
                pipelineRun = _pipelineRunClient.GetPipelineRun
                              (
                    runResponse.RunId
                              );

                _logger.LogInformation("Waiting for pipeline to start, current status: " + pipelineRun.Status);

                if (pipelineRun.Status != "Queued")
                {
                    break;
                }
                Thread.Sleep(internalWaitDuration);
            }

            return(new PipelineRunStatus()
            {
                PipelineName = request.PipelineName,
                RunId = runResponse.RunId,
                ActualStatus = pipelineRun.Status
            });
        }
コード例 #2
0
 public CreateRunResponse CreatePipelineRun(string pipelineName, string referencePipelineRunId, bool?isRecovery, string startActivityName, IDictionary <string, object> parameters)
 {
     return(_pipelineClient.CreatePipelineRun(pipelineName, referencePipelineRunId, isRecovery, startActivityName, parameters));
 }