Lift and shift ADF using powershell

Racquelle 1 Reputation point
2022-03-31T04:27:15.287+00:00

I need to lift and shift ADF (all contents) from subscription A to subscription B using release pipeline (CI/CD).
I am able to do that using ARM template. But my requirement is to achieve it using powershell script.
I need to design a powershell script to do the same. Can someone help how to approach

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,750 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,143 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,406 questions
{count} votes

2 answers

Sort by: Most helpful
  1. AaronHughes 391 Reputation points
    2022-03-31T07:34:01.487+00:00

    you can do something like this -

    ----------

    Get-AzDataFactory -Name $ADFName -ResourceGroupName $resourceGroupName -ErrorVariable notPresent -ErrorAction SilentlyContinue  
    if ($notPresent)  
    {  
    # ADF doesn't exist  
    Write-Output "ADF doesnt exists attempting to create " | timestamp  
    New-AzDataFactory -Name $ADFName -ResourceGroupName $resourceGroupName -Location $location -Tags $Tags  
    Write-Output "Resource Group created " | timestamp  
    #New-AzDataFactoryLinkedService https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorylinkedservice?view=azps-7.3.2  
    #New-AzDataFactoryDataset https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorydataset?view=azps-7.3.2  
    #New-AzDataFactoryPipeline  https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorypipeline?view=azps-7.3.2  
    #etc.   
    }  
    else  
    {  
    # ADF exist  
    Write-Output "ADF exists ready to deploy to" | timestamp  
    #New-AzDataFactoryLinkedService https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorylinkedservice?view=azps-7.3.2  
    #New-AzDataFactoryDataset https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorydataset?view=azps-7.3.2  
    #New-AzDataFactoryPipeline  https://learn.microsoft.com/en-us/powershell/module/az.datafactory/new-azdatafactorypipeline?view=azps-7.3.2  
    #etc.   
    }   
    

    ----------

    there is a ton of documentation on these PS modules
    https://learn.microsoft.com/en-us/powershell/module/az.datafactory/?view=azps-7.3.2#data-factories

    1 person found this answer helpful.
    0 comments No comments

  2. Limitless Technology 39,426 Reputation points
    2022-04-01T12:20:59.05+00:00

    Hello @Racquelle

    in addition here you can find also some samples:

    Azure PowerShell samples for Azure Data Factory
    https://learn.microsoft.com/en-us/azure/data-factory/samples-powershell

    Hope this helps with your query!

    ------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments