使用Python的Azure数据工厂

时间:2018-06-29 12:11:25

标签: python azure azure-data-factory

有人可以告诉我如何使用Python等策略变量(超时,重试等)设置Azure数据工厂中Azure管道的常规功能吗?

1 个答案:

答案 0 :(得分:0)

请在您的python代码中添加policy参数:

# Create a copy activity
act_name = 'copyBlobtoBlob'
blob_source = BlobSource()
blob_sink = BlobSink()

policy = {"timeout": "1.00:00:00",
          "concurrency": 1,
          "executionPriorityOrder": "NewestFirst",
          "style": "StartOfInterval",
          "retry": 3,
          "longRetry": 0,
          "longRetryInterval": "00:00:00"}

copy_activity = CopyActivity(act_name, source=blob_source, sink=blob_sink,
                             policy=policy)

# Create a pipeline with the copy activity
p_name = 'copyPipeline'
params_for_pipeline = {}
p_obj = PipelineResource(activities=[copy_activity], parameters=params_for_pipeline)
p = adf_client.pipelines.create_or_update(rg_name, df_name, p_name, p_obj)

测试:

enter image description here

希望它对您有帮助。