简体   繁体   English

Azure数据工厂V1

[英]Azure Data Factory V1

Is it possible to trigger a pipeline in ADF v1 using Powershell script? 是否可以使用Powershell脚本在ADF v1中触发管道?

I found this command "Resume-AzureRmDataFactoryPipeline" to trigger the pipeline, but it does not really start the pipeline.. 我发现此命令“ Resume-AzureRmDataFactoryPipeline”触发了管道,但是它并没有真正启动管道。

Please advise. 请指教。

It really depends on what your pipeline does, but an alternative method is setting the status of a slice to waiting, with the following powershell cmdlet: 这实际上取决于您的管道做什么,但是另一种方法是使用以下powershell cmdlet将切片的状态设置为等待:

$StartDateTime = (Get-Date).AddDays(-7)
$ResourceGroupName = "YourRGName"
$DSName = "YourDatasetName"
$DataFactoryV1Name = "YourDFv1Name"
Set-AzureRmDataFactorySliceStatus -DataFactoryName $DataFactoryV1Name -DatasetName $DSName -ResourceGroupName $ResourceGroupName -StartDateTime $StartDateTime -Status Waiting

Replace with your values and run after being logged in and selecting a subscription. 用您的值替换并在登录并选择订阅后运行。 What this does is sets some slices to Waiting, and if their startdatetime is in the past, data factory will run them immediately. 这样做是将一些片设置为Waiting,如果它们的开始日期时间是过去的时间,则数据工厂将立即运行它们。

Hope this helped! 希望这对您有所帮助!

Resume-AzureRmDataFactoryPipeline will work only on those pipelines which are suspended as this only Resume-AzureRmDataFactoryPipeline仅适用于那些已暂停的管道

resumes a suspended pipeline in Data Factory. 在Data Factory中恢复已暂停的管道。 Link . 链接

Now, if you want to start a pipeline then start with - 现在,如果要启动管道,请从-开始

New-AzureRmDataFactoryPipeline which would create a pipeline for you and if the pipeline already exists then it would ask for confirmation to replace the existing one. New-AzureRmDataFactoryPipeline将为您创建一个管道,如果该管道已存在,则将要求您确认以替换现有管道。

Once successfully done then you can use Set-AzureRmDataFactoryPipelineActivePeriod to configure active period for the data slices. 成功完成后,您可以使用Set-AzureRmDataFactoryPipelineActivePeriod配置数据切片的有效期。 So, this basically means after you create the pipeline, you specify the period in which data processing occurs by specifying the active period for the pipeline in which the data slices are processed. 因此,这基本上意味着在创建管道之后,您可以通过指定在其中处理数据切片的管道的活动时间段来指定发生数据处理的时间段。 These cmdlets would run only when the data factory is already created. 这些cmdlet仅在已经创建数据工厂时才运行。

You could also choose to run Set-AzureRmDataFactoryPipelineActivePeriod independently to define the active periods of the pipeline and run your data factory. 您还可以选择独立运行Set-AzureRmDataFactoryPipelineActivePeriod来定义管道的活动时间段并运行数据工厂。

You can use this command Set-AzureRmDataFactorySliceStatus . 您可以使用此命令Set-AzureRmDataFactorySliceStatus Through this, you can reset the slice to "Pending Execution" state. 通过此操作,您可以将片重置为“待执行”状态。 You also get the option to set the same status for Upstream slices so that the entire pipeline can re-run. 您还可以选择为上游片设置相同的状态,以便整个管道可以重新运行。

See this for reference https://docs.microsoft.com/en-us/powershell/module/azurerm.datafactories/set-azurermdatafactoryslicestatus?view=azurermps-5.4.0 请参阅此作为参考https://docs.microsoft.com/zh-cn/powershell/module/azurerm.datafactories/set-azurermdatafactoryslicestatus?view=azurermps-5.4.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM