C#コードでAzureでU-SQLスクリプトを実行しようとしています。コードは実行されたが、U-SQlスクリプトはADFによって実行されていないため、すべてが空白(ADF、リンクされたサービス、パイプライン、データセット)上に作成されます。私は、パイプラインコードで設定されたstartTimeとendTimeの問題があると思います。AzureデータファクトリでC#コードから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#コード私のミスを見つけるために私を助けてください:
のDateTime PipelineActivePeriodStartTime =新しいのDateTime(2017、1、12、0、0、0、0、DateTimeKind 。UTC); 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"
}
}
}
}
});
私はちょうど紺碧のデータ工場のビュー(監視と管理オプション)に何か気づいた。 PipelineのステータスはWaiting:DatasetDependenciesです。 これでコード内の何かを変更する必要がありますか?
を追加する必要があり、私は申し訳ありませんが、あなたの場合ここにコードの関連する部分を掲載することはできません。それは困難であるか、非常に時間を浪費しています。 –
こんにちは、あなたは先週同じ質問を投稿しませんでしたか?何が起こったのですか? – wBob
@wBobはい、今回はすべてのC#コンソールプロジェクトを共有していますので、誰でもコード全体をダウンロードして調べることができます。 –