2
votes

I want to create an Azure Data Factory project in Visual Studio rather than create an Azure Data Factory directly in the Azure portal. The reason why is that I wish to have the project in source control since it is a team project and for the sake of having it backed up.

I want to use Visual Studio Team Services to automate the Build and Release processes for the aforementioned Azure Data Factory project. The Build process is straightforward; it will be an MSBuild run on the solution. However, I am unsure how to go about the Release definition. Is there a task/set of tasks or a different method that will allow me to deploy my Azure Data Factory project into Azure?

1

1 Answers

3
votes

You can deploy Azure Data Factory using PowerShell.

  1. Add Azure PowerShell step/task to build/release definition
  2. Simple script:

Code:

foreach($file in Get-ChildItem "[ProjectFolder]" -filter "LinkedService*")
{
  New-AzureRmDataFactoryLinkedService -ResourceGroupName "ADF" -DataFactoryName "SampleFactory" -Name $file.BaseName -File $file.FullName -Force | Format-List
}
foreach($file in Get-ChildItem "[ProjectFolder]" -filter "DataSet*")
{
 New-AzureRmDataFactoryDataset -ResourceGroupName "ADF" -DataFactoryName "SampleFactory" -Name $file.BaseName -File $file.FullName -Force | Format-List
}
foreach($file in Get-ChildItem "[ProjectFolder]" -filter "Pipeline*")
{
 New-AzureRmDataFactoryPipeline -ResourceGroupName "ADF" -DataFactoryName "SampleFactory" -Name $file.BaseName -File $file.FullName -Force | Format-List
}

More information, you can refer to this article: Deploy Azure Data Factory using PowerShell.