azure.datafactory.tools icon indicating copy to clipboard operation
azure.datafactory.tools copied to clipboard

Incremental deployment on changed resources

Open FabioBrizzolara opened this issue 3 years ago • 1 comments

Hi,

is there a way to do an "update" deploy? If I have 100 resources but only 4 modified by the commit I would deploy only the 4 modified.

Is there a way to do this easily with the Include/Exclude Filtering Text?

Thanks Fabio

FabioBrizzolara avatar Mar 09 '22 17:03 FabioBrizzolara

There is no feature like this out of the box. You can do that using filtering capability as soon as you figure out how to determine a list of modified objects - which is not easy. I will consider adding such a feature to the module (saving somewhere last deployment state), but I don't have any ETA for now.

NowinskiK avatar Mar 14 '22 19:03 NowinskiK

This is how I did to filter unchanged objects, it is not perfect, if a pipeline fails, you have to run a full deploy:

# Get changes to deploy
$filterFilePath = (Join-Path -Path $fullRootPath -ChildPath '\filterFile.txt')
"-pipeline.*`r`n-trigger.*`r`n-dataset.*`r`n-dataflow.*`r`n-template.*" | out-file -filepath $filterFilePath -append -width 2000 -Encoding Ascii
$diff = git diff -M --name-only HEAD HEAD~1
$files = $diff.Split(" ")
ForEach ($file in $files){
    if ($file -like "src/dataplatform/data-factory/*"){
        $file = $file.replace("src/dataplatform/data-factory/", "")
        $file = $file.replace(".json", "")
        $file = $file.replace("/", ".")
        "+" + $file | out-file -filepath $filterFilePath -append -width 2000 -Encoding Ascii
    }
}

if ($_FullDeploy){
    $opt = New-AdfPublishOption -FilterFilePath $filterFilePath
}
else{
    $opt = New-AdfPublishOption
}

henriquebrisola avatar Mar 08 '23 15:03 henriquebrisola

Available in ver.1.4 (preview) https://www.powershellgallery.com/packages/azure.datafactory.tools/1.4.0-preview See documentation: https://github.com/Azure-Player/azure.datafactory.tools/tree/ver.1.4

NowinskiK avatar Apr 15 '23 21:04 NowinskiK