Edit

Share via


Upgrade Azure Data Factory pipelines to Microsoft Fabric using PowerShell

Tip

New to migration options? Start with the Microsoft Fabric migration overview for the full landscape and ADF‑to‑Fabric migration guidance. Fabric migration guidance

You can migrate your Azure Data Factory (ADF) pipelines to Microsoft Fabric using the Microsoft.FabricPipelineUpgrade PowerShell module. This guide outlines all the steps to perform the migration. For a detailed tutorial with screenshots, examples, and troubleshooting see the PowerShell migration tutorial.

To migrate your ADF pipelines to Fabric using PowerShell, you:

  1. Prepare your environment for Fabric pipeline upgrades.
  2. Connect PowerShell to your Azure and Fabric environments.
  3. Upgrade your factory pipelines.
  4. Create a resolution file and map linked services to Fabric connections.
  5. Validate your results.

Prerequisites

To get started, you must complete the following prerequisites:

Supported functionality

Alongside the currently supported datasets and linked services and currently supported activities, the following limitations apply:

  • If an Activity isn’t available in Fabric, the Fabric Upgrader can’t upgrade it.
  • Global configuration and parameters aren’t supported.
  • pipeline().Pipeline isn’t currently supported.

Currently supported datasets and linked services

  • Blob: JSON, Delimited Text, and Binary formats
  • Azure SQL Database
  • ADLS Gen2: JSON, Delimited Text, and Binary formats
  • Azure Function: Function app URL

Currently supported activities

  • CopyActivity for supported datasets
  • ExecutePipeline (converted to Fabric InvokePipeline Activity)
  • IfCondition
  • Wait
  • Web
  • SetVariable
  • Azure Function
  • ForEach
  • Lookup
  • Switch
  • SqlServerStoredProcedure

Prepare your environment for Fabric pipeline upgrades

Before you start upgrading pipelines, verify your environment has the required tools and modules:

Install PowerShell 7.4.2 (x64) or later

You need PowerShell 7.4.2 or later on your machine.

Download PowerShell

Install and import the FabricPipelineUpgrade module

  1. Open PowerShell 7 (x64).

  2. Select the Start menu, search for PowerShell 7, open the app's context menu, and select Run as administrator.

    Screenshot of the PowerShell icon.

  3. In the elevated PowerShell window, install the module from the PowerShell Gallery:

    Install-Module Microsoft.FabricPipelineUpgrade -Repository PSGallery -SkipPublisherCheck
    
  4. Import the module into your session:

    Import-Module Microsoft.FabricPipelineUpgrade
    
  5. If you see a signing or execution policy error, run this command and then import the module again:

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
    

Verify your installation

Run this command to confirm the module loaded correctly:

Get-Command -Module Microsoft.FabricPipelineUpgrade

Screenshot of the module command output.

Connect PowerShell to your Azure and Fabric environments

Run these commands in PowerShell to sign in and set your subscription and tenant for subsequent Az cmdlets:

Add-AzAccount
Select-AzSubscription -SubscriptionId <your subscription ID>

Run these commands to get access tokens for ADF and Fabric:

$adfSecureToken = (Get-AzAccessToken -ResourceUrl "https://management.azure.com/").Token
$fabricSecureToken = (Get-AzAccessToken -ResourceUrl "https://analysis.windows.net/powerbi/api").Token

Tip

Access tokens expire after about an hour. When that happens, run the command again. You’ll know the token expired if Export-FabricResources returns a token expiry error.

Upgrade your factory resources

First, import your Azure Data Factory pipelines, then map your ADF linked services to Fabric connections, and finally upgrade your pipelines.

Import your Azure Data Factory pipelines

The following PowerShell will import your data factory resources. Update the Import-AdfFactory command before the first | to either import all supported resources in your ADF, or a single pipeline.

Import-AdfFactory -SubscriptionId <your subscription ID> -ResourceGroupName <your Resource Group Name> -FactoryName <your Factory Name> -PipelineName <your Pipeline Name> -AdfToken $adfSecureToken| ConvertTo-FabricResources | Export-FabricResources -Region <region> -Workspace <workspaceId> -Token $fabricSecureToken

Tip

The region parameter is optional. If your Fabric workspace is in the same region as your ADF, you can either use that region or skip the -Region parameter.

Import all factory resources

Import-AdfFactory -SubscriptionId <your subscription ID> -ResourceGroupName <your Resource Group Name> -FactoryName <your Factory Name> -AdfToken $adfSecureToken

Import a single pipeline

It's the same command you used to import all factory resources, but you add -PipelineName:

Import-AdfFactory -SubscriptionId <your subscription ID> -ResourceGroupName <your Resource Group Name> -FactoryName <your Factory Name> -PipelineName <your Pipeline Name> -AdfToken $adfSecureToken

Map your ADF linked services to Fabric connections

  1. If your Fabric instance doesn't already have connections to the data sources used in your ADF linked services, create those connections in Fabric.
  2. Create your resolution file to tell FabricUpgrader how to map your ADF linked services to Fabric connections.

Create your resolution file

A resolution file is a JSON file that maps your ADF linked services to Fabric connections:

[
  {
    "type": "LinkedServiceToConnectionId",
    "key": "<ADF LinkedService Name>",
    "value": "<Fabric Connection ID>"
  }
]

So, for example, if you have two ADF linked services named MyAzureBlobStorage and MySQLServer that you want to map to Fabric connections, your file would look like this:

[
  {
    "type": "LinkedServiceToConnectionId",
    "key": "MyAzureBlobStorage",
    "value": "aaaa0000-bb11-2222-33cc-444444dddddd"
  },
  {
    "type": "LinkedServiceToConnectionId",
    "key": "MySQLServer",
    "value": "bbbb1111-cc22-3333-44dd-555555eeeeee"
  }
]

Create your Resolutions.json file using this structure and save it somewhere on your machine so that PowerShell can access it.

For more information about the resolution file, see How to add a connection to the resolutions file.

PowerShell command to upgrade your pipelines

Now that you have your resolution file, you can run this PowerShell command to perform the upgrade. Update the ResolutionFilename parameter to point to your resolution file. Also, update the Import-AdfFactory command before the first | to either import all supported resources in your ADF, or a single pipeline.

Import-AdfFactory -SubscriptionId <your subscription ID> -ResourceGroupName <your Resource Group Name> -FactoryName <your Factory Name> -PipelineName <your Pipeline Name> -AdfToken $adfSecureToken | ConvertTo-FabricResources | Import-FabricResolutions -ResolutionsFilename "<path to your resolutions file>" | Export-FabricResources -Region <region> -Workspace <workspaceId> -Token $fabricSecureToken

Tip

If the upgrade fails, PowerShell will display the reason in the details section. For some examples and troubleshooting, see the Tutorial.

Validate the results in Microsoft Fabric

Once your migration completes, open each pipeline in Microsoft Fabric and verify activities, parameters, and dataset connections.

Run test executions with safe sample inputs and compare outputs to your source ADF runs to confirm parity.

Fix any gaps (for example, activities that don’t have a direct Fabric equivalent yet).

Step‑by‑step tutorial

For a detailed tutorial with screenshots, examples, and troubleshooting see the PowerShell migration tutorial.