static void Main(string[] args) { Console.WriteLine("Hello I am Calling ADF pipeline from C#...."); ADFHelper _azureDataFactory = new ADFHelper(); AzureDataFactoryModel azureDataFactoryModel = new AzureDataFactoryModel(); azureDataFactoryModel.ResourceGroupName = "xxxx"; azureDataFactoryModel.FactoryName = "xxxx"; azureDataFactoryModel.PipeLineName = "xxxx"; azureDataFactoryModel.Parameters = new Dictionary <string, object> { { "P1", "parameter 1" }, { "P2", "parameter 2" }, { "P3", "parameter 3" } }; var runId = _azureDataFactory.TriggerAdfAsync(azureDataFactoryModel).ConfigureAwait(false); Console.WriteLine($"Run Id : {runId}"); }
public async Task <string> TriggerAdfAsync(AzureDataFactoryModel azureDataFactoryModel) { try { var runResponse = await _dataFactoryClient.Pipelines.CreateRunWithHttpMessagesAsync( azureDataFactoryModel.ResourceGroupName, azureDataFactoryModel.FactoryName, azureDataFactoryModel.PipeLineName, parameters : azureDataFactoryModel.Parameters ).ConfigureAwait(false); return(runResponse.Body.RunId); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } }