Copying Azure Table Storage using Azure Data Factory (ADF)

Published Jan 24 2022 06:25 PM 2,241 Views
Microsoft

Background:

Many times we have a requirement to migrate azure storage tables from one storage account to another. For a small number of tables, you can choose the following options:

 

For storage accounts containing large number of tables, we can also use Azure Data Factory (ADF). This blog demostrates how we can use ADF for copying storage tables across 2 storage accounts.

 

1. Storage Accounts:

In this blob, we will be moving storage tables from a source account to destination storage account. In the source storage account we currently have 10 tables:

ankitsharma_2-1642237094070.png

 

These tables are populated with some sample data:

ankitsharma_3-1642237282466.png

 

In the destination, there are no tables.

ankitsharma_1-1642237031519.png

 

2. SAS Tokens

As we need to make REST API calls to both the storage accounts, we will be using SAS tokens to authorize the calls. 

 

We will create a service SAS token for accessing both storage accounts. You can fine tune the permissions if required. I will be creating SAS using following permissions for both accounts:

ankitsharma_0-1642239888689.png

 

3. Creating ADF

We will now create an Azure Data Factory (ADF) resource. If you are new to ADF, please refer this link on how to create one: https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-portal#create-a-d...

 

Once created we can access the Azure Data Factory UI page using the link on Overview as shown below:

ankitsharma_1-1642240335374.png

 

4. Authoring the pipelines

We will create our pipeline that we can use to setup our copy process. 

ankitsharma_3-1642240543792.png

 

We will add two parameters in this pipeline, to save our SAS tokens. We can use these parameters in the pipeline. Once expired, we can update the parameter values.

ankitsharma_6-1642241252168.png

 

5. Creating the activities

Now that the pipeline is created we will add the activities for the copy process. The flow for this process is as follows:

  1. Get the list of all tables from source storage account.
  2. Loop through the tables and perform:
    1. Create table operation on the destination storage account.
    2. Copy operation from source to destination.

 

5.1 List tables from source storage account

We will use a Web Activity for this operation. Using this activity we will make a REST API call to storage service with SAS token to fetch the list of tables. The API being used is Query Tables.

 

In the URL we are providing the source storage endpoint as per the API specification, concatenating with the sourceSAS parameter we saved earlier.

@concat('https://SOURCE.table.core.windows.net/Tables', pipeline().parameters.sourceSAS)
To learn more about expressions and functions in ADF please refer this documetation: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions
 
As we need the response in JSON, we are passing the 'Accept' header with 'application/json'.

ankitsharma_8-1642241563296.png

 

Once configured, we can publish the changes.
ankitsharma_9-1642241623918.png

 

5.2 Reading the output and looping through tables

Add a ForEach activity, which will be used to loop through list of tables received from REST API.

ankitsharma_10-1642241809928.png

 

In the Items setting, we will use the output of the previous activity for this loop. We have added ".value' as this is property that contains the array of tables returned by REST API.

 

5.3 Creating Tables in destination account

The rest of the activities will be created inside ForEach activity.

ankitsharma_11-1642241980099.png

 

We will use another Web Activity to call the Create Table REST API on the destination storage account. Configure the Web Activity according to Create Table REST API specification.

ankitsharma_13-1642242568670.png

 

We are passing the table name in Body dynamically using the 'item' object from ForEach activity.

 

5.4 Copy Data

The next item is 'Copy data' activity, which will peform the data copy between both storage accounts. Copy data activity will require a Dataset and Linked Service to connect to storage account. For datasets, click on on 'New' for both source & sink(destination) and select 'Azure Table Storage' to continue. Provide a relevant name.

 

ankitsharma_0-1642246283581.png

 

You can follow the steps shared in this documents to create linked service for both of your storage accounts: https://docs.microsoft.com/en-us/azure/data-factory/connector-azure-table-storage?tabs=data-factory#...

 

Once you have created the datasets & linked service for both source & sink account, we need to configure the datasets to pass the Table names dynamically. Use the "item" object of ForEach activity to get the table name, for both source and destination(sink) datasets as shown below:

Create a parameter in both datasets:

ankitsharma_1-1642244598358.png

Use the parameter as table name in dataset:

ankitsharma_2-1642244627585.png

 

Pass the current item to the dataset from Copy data activity:

ankitsharma_3-1642244671602.png

 

Tip: You can further optimize your ADF to use storage account name, SAS tokens etc. dynamically using parameters and variables. To learn more on the same refer this documentation: https://azure.microsoft.com/en-in/resources/azure-data-factory-passing-parameters/

 

6. Run the activity

We can now run the activity to start the copy process. The pipeline will complete depending on the number of tables and data in the source storage account.

ankitsharma_4-1642245339974.png

 

We can see that tables are now created in the destination storage account:

ankitsharma_5-1642245402700.png

 

And the data is copied too.

ankitsharma_6-1642245492552.png

 

Tip: You can also add a Delete Table API request after the Copy data activity to delete the table in source storage account.

1 Comment
%3CLINGO-SUB%20id%3D%22lingo-sub-3062401%22%20slang%3D%22en-US%22%3ECopying%20Azure%20Table%20Storage%20using%20Azure%20Data%20Factory%20(ADF)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3062401%22%20slang%3D%22en-US%22%3E%3CH3%20id%3D%22toc-hId--1461434979%22%20id%3D%22toc-hId--1458718940%22%20id%3D%22toc-hId--1458718940%22%20id%3D%22toc-hId--1458718940%22%3EBackground%3A%3C%2FH3%3E%0A%3CP%3EMany%20times%20we%20have%20a%20requirement%20to%20migrate%20azure%20storage%20tables%20from%20one%20storage%20account%20to%20another.%20For%20a%20small%20number%20of%20tables%2C%20you%20can%20choose%20the%20following%20options%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Ffeatures%2Fstorage-explorer%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Storage%20Explorer%3C%2FA%3E%20to%20export-import%20data%20from%20tables.%3C%2FLI%3E%0A%3CLI%3EUse%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fazure%2Fstorage%2Fstorage-use-azcopy%23azcopy-with-table-support-v73%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzCopy%20v7.3%3C%2FA%3E%2C%20which%20has%20table%20support%2C%20to%20download-upload%20data%20from%20storage%20tables.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20storage%20accounts%20containing%20large%20number%20of%20tables%2C%20we%20can%20also%20use%20Azure%20Data%20Factory%20(ADF).%20This%20blog%20demostrates%20how%20we%20can%20use%20ADF%20for%20copying%20storage%20tables%20across%202%20storage%20accounts.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1026077854%22%20id%3D%22toc-hId-1028793893%22%20id%3D%22toc-hId-1028793893%22%20id%3D%22toc-hId-1028793893%22%3E1.%20Storage%20Accounts%3A%3C%2FH3%3E%0A%3CP%3EIn%20this%20blob%2C%20we%20will%20be%20moving%20storage%20tables%20from%20a%20source%20account%20to%20destination%20storage%20account.%20In%20the%20source%20storage%20account%20we%20currently%20have%2010%20tables%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_2-1642237094070.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339759i95CFEC74EA1AFC6B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_2-1642237094070.png%22%20alt%3D%22ankitsharma_2-1642237094070.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThese%20tables%20are%20populated%20with%20some%20sample%20data%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_3-1642237282466.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339760iB73A3EEAEA21020D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_3-1642237282466.png%22%20alt%3D%22ankitsharma_3-1642237282466.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20destination%2C%20there%20are%20no%20tables.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_1-1642237031519.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339758iDDDF7E43CF91AC67%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_1-1642237031519.png%22%20alt%3D%22ankitsharma_1-1642237031519.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--781376609%22%20id%3D%22toc-hId--778660570%22%20id%3D%22toc-hId--778660570%22%20id%3D%22toc-hId--778660570%22%3E2.%20SAS%20Tokens%3C%2FH3%3E%0A%3CP%3EAs%20we%20need%20to%20make%20REST%20API%20calls%20to%20both%20the%20storage%20accounts%2C%20we%20will%20be%20using%20SAS%20tokens%20to%20authorize%20the%20calls.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20create%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-sas-overview%23service-sas%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eservice%20SAS%20token%3C%2FA%3E%20for%20accessing%20both%20storage%20accounts.%20You%20can%20fine%20tune%20the%20permissions%20if%20required.%20I%20will%20be%20creating%20SAS%20using%20following%20permissions%20for%20both%20accounts%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_0-1642239888689.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339766i462D4EC16F38B438%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_0-1642239888689.png%22%20alt%3D%22ankitsharma_0-1642239888689.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1706136224%22%20id%3D%22toc-hId-1708852263%22%20id%3D%22toc-hId-1708852263%22%20id%3D%22toc-hId-1708852263%22%3E3.%20Creating%20ADF%3C%2FH3%3E%0A%3CP%3EWe%20will%20now%20create%20an%20Azure%20Data%20Factory%20(ADF)%20resource.%20If%20you%20are%20new%20to%20ADF%2C%20please%20refer%20this%20link%20on%20how%20to%20create%20one%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fquickstart-create-data-factory-portal%23create-a-data-factory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fquickstart-create-data-factory-portal%23create-a-data-factory%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20created%20we%20can%20access%20the%20Azure%20Data%20Factory%20UI%20page%20using%20the%20link%20on%20Overview%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_1-1642240335374.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339767iF52493BBA053753A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_1-1642240335374.png%22%20alt%3D%22ankitsharma_1-1642240335374.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--101318239%22%20id%3D%22toc-hId--98602200%22%20id%3D%22toc-hId--98602200%22%20id%3D%22toc-hId--98602200%22%3E4.%20Authoring%20the%20pipelines%3C%2FH3%3E%0A%3CP%3EWe%20will%20create%20our%20pipeline%20that%20we%20can%20use%20to%20setup%20our%20copy%20process.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_3-1642240543792.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339769iA5BF462D37CD71CD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_3-1642240543792.png%22%20alt%3D%22ankitsharma_3-1642240543792.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20add%20two%20parameters%20in%20this%20pipeline%2C%20to%20save%20our%20SAS%20tokens.%20We%20can%20use%20these%20parameters%20in%20the%20pipeline.%20Once%20expired%2C%20we%20can%20update%20the%20parameter%20values.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_6-1642241252168.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339773iE4C4B5E0BEEBF5F1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_6-1642241252168.png%22%20alt%3D%22ankitsharma_6-1642241252168.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1908772702%22%20id%3D%22toc-hId--1906056663%22%20id%3D%22toc-hId--1906056663%22%20id%3D%22toc-hId--1906056663%22%3E5.%20Creating%20the%20activities%3C%2FH3%3E%0A%3CP%3ENow%20that%20the%20pipeline%20is%20created%20we%20will%20add%20the%20activities%20for%20the%20copy%20process.%20The%20flow%20for%20this%20process%20is%20as%20follows%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGet%20the%20list%20of%20all%20tables%20from%20source%20storage%20account.%3C%2FLI%3E%0A%3CLI%3ELoop%20through%20the%20tables%20and%20perform%3A%3COL%20class%3D%22lia-list-style-type-lower-roman%22%3E%0A%3CLI%3ECreate%20table%20operation%20on%20the%20destination%20storage%20account.%3C%2FLI%3E%0A%3CLI%3ECopy%20operation%20from%20source%20to%20destination.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--1218211228%22%20id%3D%22toc-hId--1215495189%22%20id%3D%22toc-hId--1215495189%22%20id%3D%22toc-hId--1215495189%22%3E5.1%20List%20tables%20from%20source%20storage%20account%3C%2FH4%3E%0A%3CP%3EWe%20will%20use%20a%20Web%20Activity%20for%20this%20operation.%20Using%20this%20activity%20we%20will%20make%20a%20REST%20API%20call%20to%20storage%20service%20with%20SAS%20token%20to%20fetch%20the%20list%20of%20tables.%26nbsp%3BThe%20API%20being%20used%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fquery-tables%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EQuery%20Tables%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20URL%20we%20are%20providing%20the%20source%20storage%20endpoint%20as%20per%20the%20API%20specification%2C%20concatenating%20with%20the%20sourceSAS%20parameter%20we%20saved%20earlier.%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%3E%40%3C%2FSPAN%3E%3CSPAN%3Econcat%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E'https%3A%2F%2FSOURCE.table.core.windows.net%2FTables'%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Epipeline%3C%2FSPAN%3E%3CSPAN%3E().%3C%2FSPAN%3E%3CSPAN%3Eparameters%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EsourceSAS%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CDIV%3E%3CSPAN%3ETo%20learn%20more%20about%20expressions%20and%20functions%20in%20ADF%20please%20refer%20this%20documetation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fcontrol-flow-expression-language-functions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fcontrol-flow-expression-language-functions%3C%2FA%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EAs%20we%20need%20the%20response%20in%20JSON%2C%20we%20are%20passing%20the%20'Accept'%20header%20with%20'application%2Fjson'.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CH4%20id%3D%22toc-hId-1269301605%22%20id%3D%22toc-hId-1272017644%22%20id%3D%22toc-hId-1272017644%22%20id%3D%22toc-hId-1272017644%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_8-1642241563296.png%22%20style%3D%22width%3A%20403px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339775i92779F3F6A73C23C%2Fimage-dimensions%2F403x259%3Fv%3Dv2%22%20width%3D%22403%22%20height%3D%22259%22%20role%3D%22button%22%20title%3D%22ankitsharma_8-1642241563296.png%22%20alt%3D%22ankitsharma_8-1642241563296.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20configured%2C%20we%20can%20publish%20the%20changes.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_9-1642241623918.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339776i2DA7109A1F800991%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_9-1642241623918.png%22%20alt%3D%22ankitsharma_9-1642241623918.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--538152858%22%20id%3D%22toc-hId--535436819%22%20id%3D%22toc-hId--535436819%22%20id%3D%22toc-hId--535436819%22%3E5.2%20Reading%20the%20output%20and%20looping%20through%20tables%3C%2FH4%3E%0A%3CP%3EAdd%20a%20ForEach%20activity%2C%20which%20will%20be%20used%20to%20loop%20through%20list%20of%20tables%20received%20from%20REST%20API.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1949359975%22%20id%3D%22toc-hId-1952076014%22%20id%3D%22toc-hId-1952076014%22%20id%3D%22toc-hId-1952076014%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_10-1642241809928.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339777i830E6C8A38F7BFE0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_10-1642241809928.png%22%20alt%3D%22ankitsharma_10-1642241809928.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20Items%20setting%2C%20we%20will%20use%20the%20output%20of%20the%20previous%20activity%20for%20this%20loop.%20We%20have%20added%20%22.value'%20as%20this%20is%20property%20that%20contains%20the%20array%20of%20tables%20returned%20by%20REST%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-1372776111%22%20id%3D%22toc-hId-1375492150%22%20id%3D%22toc-hId-1375492150%22%20id%3D%22toc-hId-1375492150%22%3E5.3%20Creating%20Tables%20in%20destination%20account%3C%2FH4%3E%0A%3CP%3EThe%20rest%20of%20the%20activities%20will%20be%20created%20inside%20ForEach%20activity.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--434678352%22%20id%3D%22toc-hId--431962313%22%20id%3D%22toc-hId--431962313%22%20id%3D%22toc-hId--431962313%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_11-1642241980099.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339778i88D79741A511A4CE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_11-1642241980099.png%22%20alt%3D%22ankitsharma_11-1642241980099.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20use%20another%20Web%20Activity%20to%20call%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fcreate-table%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20Table%20REST%20API%3C%2FA%3E%20on%20the%20destination%20storage%20account.%20Configure%20the%20Web%20Activity%20according%20to%20Create%20Table%20REST%20API%20specification.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-2052834481%22%20id%3D%22toc-hId-2055550520%22%20id%3D%22toc-hId-2055550520%22%20id%3D%22toc-hId-2055550520%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_13-1642242568670.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339781i9C55FF70C7E07356%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_13-1642242568670.png%22%20alt%3D%22ankitsharma_13-1642242568670.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FH4%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20are%20passing%20the%20table%20name%20in%20Body%20dynamically%20using%20the%20'item'%20object%20from%20ForEach%20activity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-245380018%22%20id%3D%22toc-hId-248096057%22%20id%3D%22toc-hId-248096057%22%20id%3D%22toc-hId-248096057%22%3E5.4%20Copy%20Data%3C%2FH4%3E%0A%3CP%3EThe%20next%20item%20is%20'Copy%20data'%20activity%2C%20which%20will%20peform%20the%20data%20copy%20between%20both%20storage%20accounts.%20Copy%20data%20activity%20will%20require%20a%20Dataset%20and%20Linked%20Service%20to%20connect%20to%20storage%20account.%20For%20datasets%2C%20click%20on%20on%20'New'%20for%20both%20source%20%26amp%3B%20sink(destination)%20and%20select%20'Azure%20Table%20Storage'%20to%20continue.%20Provide%20a%20relevant%20name.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_0-1642246283581.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339796i9D9AB2FDB94C8AC4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_0-1642246283581.png%22%20alt%3D%22ankitsharma_0-1642246283581.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20follow%20the%20steps%20shared%20in%20this%20documents%20to%20create%20linked%20service%20for%20both%20of%20your%20storage%20accounts%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fconnector-azure-table-storage%3Ftabs%3Ddata-factory%23create-an-azure-table-storage-linked-service-using-ui%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fconnector-azure-table-storage%3Ftabs%3Ddata-factory%23create-an-azure-table-storage-linked-service-using-ui%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20created%20the%20datasets%20%26amp%3B%20linked%20service%20for%20both%20source%20%26amp%3B%20sink%20account%2C%20we%20need%20to%20configure%20the%20datasets%20to%20pass%20the%20Table%20names%20dynamically.%20Use%20the%20%22item%22%20object%20of%20ForEach%20activity%20to%20get%20the%20table%20name%2C%20for%20both%20source%20and%20destination(sink)%20datasets%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3ECreate%20a%20parameter%20in%20both%20datasets%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_1-1642244598358.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339787i5D463AFBC3702629%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_1-1642244598358.png%22%20alt%3D%22ankitsharma_1-1642244598358.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EUse%20the%20parameter%20as%20table%20name%20in%20dataset%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_2-1642244627585.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339788iF024FB0A6728344A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_2-1642244627585.png%22%20alt%3D%22ankitsharma_2-1642244627585.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPass%20the%20current%20item%20to%20the%20dataset%20from%20Copy%20data%20activity%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_3-1642244671602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339789iAAB99E6D8BEEADB5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_3-1642244671602.png%22%20alt%3D%22ankitsharma_3-1642244671602.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETip%3A%20You%20can%20further%20optimize%20your%20ADF%20to%20use%20storage%20account%20name%2C%20SAS%20tokens%20etc.%20dynamically%20using%20parameters%20and%20variables.%20To%20learn%20more%20on%20the%20same%20refer%20this%20documentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-in%2Fresources%2Fazure-data-factory-passing-parameters%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazure.microsoft.com%2Fen-in%2Fresources%2Fazure-data-factory-passing-parameters%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1691157164%22%20id%3D%22toc-hId--1688441125%22%20id%3D%22toc-hId--1688441125%22%20id%3D%22toc-hId--1688441125%22%3E6.%20Run%20the%20activity%3C%2FH3%3E%0A%3CP%3EWe%20can%20now%20run%20the%20activity%20to%20start%20the%20copy%20process.%20The%20pipeline%20will%20complete%20depending%20on%20the%20number%20of%20tables%20and%20data%20in%20the%20source%20storage%20account.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_4-1642245339974.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339793i9734CEC0B16ED8F5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_4-1642245339974.png%22%20alt%3D%22ankitsharma_4-1642245339974.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20see%20that%20tables%20are%20now%20created%20in%20the%20destination%20storage%20account%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_5-1642245402700.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339794i825EBB24A83305D9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_5-1642245402700.png%22%20alt%3D%22ankitsharma_5-1642245402700.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20the%20data%20is%20copied%20too.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_6-1642245492552.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339795iDDF47E039E81CCB3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_6-1642245492552.png%22%20alt%3D%22ankitsharma_6-1642245492552.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETip%3A%20You%20can%20also%20add%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fdelete-table%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EDelete%20Table%20API%3C%2FA%3E%20request%20after%20the%20Copy%20data%20activity%20to%20delete%20the%20table%20in%20source%20storage%20account.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3062401%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20blog%20demonstrates%20migrating%20%2F%20copying%20storage%20account%20tables%20from%20one%20storage%20account%20to%20another%20using%26nbsp%3BAzure%20Data%20Factory%20(ADF)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ankitsharma_0-1642244539047.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F339786i1A642F8B175F82D9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ankitsharma_0-1642244539047.png%22%20alt%3D%22ankitsharma_0-1642244539047.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3062401%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Storage%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3283035%22%20slang%3D%22en-US%22%3ERe%3A%20Copying%20Azure%20Table%20Storage%20using%20Azure%20Data%20Factory%20(ADF)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3283035%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F668931%22%20target%3D%22_blank%22%3E%40ankitsharma%3C%2FA%3E%26nbsp%3BI%20cannot%20read%20the%20syntax%20in%20the%20%3CSTRONG%3Ebody%3C%2FSTRONG%3E%20field%20when%20creating%20the%20tables%2C%20in%20step%205.3.%3CBR%20%2F%3EWould%20you%20mind%20posting%20it%20where%20it%20can%20be%20read%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Jan 17 2022 11:21 PM
Updated by: