2017-01-16 109 views
0

我想通過C#代碼在Azure上運行U-SQL腳本。在代碼執行後,所有東西都在azure(ADF,鏈接服務,管道,數據集)上創建,但ADF不執行U-SQl腳本。我認爲在管道代碼中配置startTime和end Time有問題。從C#代碼與Azure數據工廠運行U-SQL腳本

我按照以下文章來完成這個控制檯應用程序。 Create, monitor, and manage Azure data factories using Data Factory .NET SDK

這是我完整的C#代碼項目下載的URL。 https://1drv.ms/u/s!AltdTyVEmoG2ijOupx-EjCM-8Zk4

有人請幫我找出我的錯誤

C#代碼來配置管道:

日期時間PipelineActivePeriodStartTime =新的日期時間(2017年,1,12,0,0,0,0,DateTimeKind 。世界標準時間); DateTime PipelineActivePeriodEndTime = PipelineActivePeriodStartTime.AddMinutes(60); string PipelineName =「ComputeEventsByRegionPipeline」;

 var usqlparams = new Dictionary<string, string>(); 
     usqlparams.Add("in", "/Samples/Data/SearchLog.tsv"); 
     usqlparams.Add("out", "/Output/testdemo1.tsv"); 

     client.Pipelines.CreateOrUpdate(resourceGroupName, dataFactoryName, 
     new PipelineCreateOrUpdateParameters() 
     { 
      Pipeline = new Pipeline() 
      { 
       Name = PipelineName, 
       Properties = new PipelineProperties() 
       { 
        Description = "This is a demo pipe line.", 

        // Initial value for pipeline's active period. With this, you won't need to set slice status 
        Start = PipelineActivePeriodStartTime, 
        End = PipelineActivePeriodEndTime, 
        IsPaused = false, 

        Activities = new List<Activity>() 
        { 
         new Activity() 
         { 
          TypeProperties = new DataLakeAnalyticsUSQLActivity("@searchlog = EXTRACT UserId int, Start DateTime, Region string, Query string, Duration int?, Urls string, ClickedUrls string FROM @in USING Extractors.Tsv(nullEscape:\"#NULL#\"); @rs1 = SELECT Start, Region, Duration FROM @searchlog; OUTPUT @rs1 TO @out USING Outputters.Tsv(quoting:false);") 
          { 
           DegreeOfParallelism = 3, 
           Priority = 100, 
           Parameters = usqlparams 
          }, 
          Inputs = new List<ActivityInput>() 
          { 
           new ActivityInput(Dataset_Source) 
          }, 
          Outputs = new List<ActivityOutput>() 
          { 
           new ActivityOutput(Dataset_Destination) 
          }, 
          Policy = new ActivityPolicy() 
          { 
           Timeout = new TimeSpan(6,0,0), 
           Concurrency = 1, 
           ExecutionPriorityOrder = ExecutionPriorityOrder.NewestFirst, 
           Retry = 1 
          }, 
          Scheduler = new Scheduler() 
          { 
           Frequency = "Day", 
           Interval = 1 
          }, 
          Name = "EventsByRegion", 
          LinkedServiceName = "AzureDataLakeAnalyticsLinkedService" 
         } 
        } 
       } 
      } 
     }); 

我剛剛注意到天青數據工廠視圖(監視器和管理選項)中的某些內容。管道狀態爲等待:數據集依賴關係Azure Data Factory Monitor and Manage view我是否需要修改代碼中的某些內容?

+0

我很抱歉,但如果你不能在這裏發佈代碼的相關部分,那麼很難或非常耗時的幫助。 –

+0

嗨,你上週沒有發表過同樣的問題嗎?那件事發生了什麼? – wBob

+0

@wBob是的,但是這次我已經共享完整的C#控制檯項目,以便任何人都可以下載並查看整個代碼。 –

回答