Azure Data Factory V1

点点圈 提交于 2019-12-11 17:17:48

问题


Is it possible to trigger a pipeline in ADF v1 using Powershell script?

I found this command "Resume-AzureRmDataFactoryPipeline" to trigger the pipeline, but it does not really start the pipeline..

Please advise.


回答1:


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:

$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.

Hope this helped!




回答2:


Resume-AzureRmDataFactoryPipeline will work only on those pipelines which are suspended as this only

resumes a suspended pipeline in 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.

Once successfully done then you can use Set-AzureRmDataFactoryPipelineActivePeriod to configure active period for the data slices. 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.

You could also choose to run Set-AzureRmDataFactoryPipelineActivePeriod independently to define the active periods of the pipeline and run your data factory.




回答3:


You can use this command 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://stackoverflow.com/questions/49167400/azure-data-factory-v1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!