How to pass arguments to ADF pipeline using powers

2020-03-30 18:40发布

问题:

I have created a pipeline which has two parameters at pipeline level. I want to send the values to these parameters using powershell and trigger the pipeline. Any idea how to do it using Powershell.

回答1:

I'll leave a script that you can then modify to your needs:

Login-AzureRmAccount
Select-AzureRmSubscription -Subscription "yourSubId"

$dfname = "youDataFActoryName"
$rgName = "yourResourceGroupName"
$pipe = "pipeName"
$parameters = @{
    "param1" = "asdasd"
    "param2" = "123456"
}

Invoke-AzureRmDataFactoryV2Pipeline -DataFactoryName $dfname -ResourceGroupName $rgName -PipelineName $pipe -Parameter $parameters

Hope this helped!