Skip to content

Latest commit

 

History

History
83 lines (52 loc) · 7.47 KB

delete-data-activity.md

File metadata and controls

83 lines (52 loc) · 7.47 KB
title description ms.reviewer ms.author author ms.topic ms.custom ms.date
Delete data activity
Learn how to add a Delete data activity to a pipeline and use it to delete data from a data source.
jburchel
yexu
dearandyxu
how-to
build-2023
ignite-2023
11/15/2023

Use the Delete data activity to look up data from a data source

The Fabric Delete data activity can delete data from any of the data sources supported by [!INCLUDE product-name].

You can use the Delete Activity in Data Factory to delete files or folders from any supported storage stores. Use this activity to clean up or archive files when they are no longer needed.

Prerequisites

To get started, you must complete the following prerequisites:

Add a lookup activity to a pipeline with UI

To use a Delete data activity in a pipeline, complete the following steps:

Creating the activity

  1. Create a new pipeline in your workspace.

  2. Search for Delete data in the pipeline Activities pane, and select it to add it to the pipeline canvas.

    :::image type="content" source="media/delete-data-activity/add-delete-data-activity-to-pipeline.png" alt-text="Screenshot of the Fabric UI with the Activities pane and Delete data activity highlighted.":::

  3. Select the new Delete data activity on the canvas if it isn't already selected.

    :::image type="content" source="media/delete-data-activity/delete-data-activity-general-settings.png" alt-text="Screenshot showing the General settings tab of the Delete data activity.":::

Refer to the General settings guidance to configure the General settings tab.

Choose a data source

Select the Source tab, and select an existing connection from the Connection dropdown, or use the + New button to create a new connection, and specify its configuration details.

:::image type="content" source="media/delete-data-activity/choose-delete-data-source-and-configure.png" alt-text="Screenshot showing the Delete data activity Source tab highlighted, and highlighting where to create a new connection.":::

The example in the previous image shows a blob storage connection, but each connection type has its own configuration details specific to the data source selected.

Supported data stores

Fabric supports the data stores listed in the Connector overview article. Any source that supports the Delete data activity can be used.

Examples of using the Delete activity

Delete specific folders or files

The store has the following folder structure:

Root/
    Folder_A_1/
        1.txt
        2.txt
        3.csv
    Folder_A_2/
        4.txt
        5.csv
        Folder_B_1/
            6.txt
            7.csv
        Folder_B_2/
            8.txt

Now you are using the Delete activity to delete folder or files by the combination of different property value from the dataset and the Delete activity:

folderPath fileName recursive Output
Root/ Folder_A_2 NULL False Root/
    Folder_A_1/
        1.txt
        2.txt
        3.csv
    Folder_A_2/
        4.txt
        5.csv
        Folder_B_1/
            6.txt
            7.csv
        Folder_B_2/
            8.txt
Root/ Folder_A_2 NULL True Root/
    Folder_A_1/
        1.txt
        2.txt
        3.csv
    Folder_A_2/
        4.txt
        5.csv
        Folder_B_1/
            6.txt
            7.csv
        Folder_B_2/
            8.txt
Root/ Folder_A_2 *.txt False Root/
    Folder_A_1/
        1.txt
        2.txt
        3.csv
    Folder_A_2/
        4.txt
        5.csv
        Folder_B_1/
            6.txt
            7.csv
        Folder_B_2/
            8.txt
Root/ Folder_A_2 *.txt True Root/
    Folder_A_1/
        1.txt
        2.txt
        3.csv
    Folder_A_2/
        4.txt
        5.csv
        Folder_B_1/
            6.txt
            7.csv
        Folder_B_2/
            8.txt

Save and run or schedule the pipeline

  1. Switch to the Home tab at the top of the pipeline editor, and select the save button to save your pipeline.
  2. Select Run to run it directly, or Schedule to schedule it.
  3. You can also view the run history here or configure other settings.

:::image type="content" source="media/delete-data-activity/pipeline-home-tab.png" alt-text="Screenshot showing the Home tab in the pipeline editor with the tab name, Save, Run, and Schedule buttons highlighted.":::

Related content