Support of Multiselect List in Azure Data Factory parameters

Ravindra Raghuvanshi (Consultant) 20 Reputation points
2023-07-07T05:36:31.2866667+00:00

Hello Team,

We are working on a scenario where we want to provide a capability to user to select some values (Multiple) from a predefined list of values. And as a result, the data factory should run only for the selected values and not for all the values present in the list.

For example: I have a list of fruits like Apple, Banana, Papaya, Orange etc.

Now user is triggering ADF pipeline, and he/she can select 1 or more fruits from above list and pipeline will work only for that list of selection.

We are using databricks too in this pipeline and need to pass the selection to databricks notebook as well. Do we have support for the same in ADF?

Something like below:

User's image

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,514 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
0 comments No comments
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2023-07-10T05:15:30.93+00:00

    Hi Ravindra Raghuvanshi (Consultant),

    Thank you for posting query in Microsoft Q&A Platform.

    Please note, ADF cannot provide UI to popup values to select. So you need consider writing your own code to create a UI to show up values. And then In the code behind of UI you need to capture selected values and then consider making API call to ADF pipeline to start running pipeline. Here, your ADF pipeline should have parameters in it to take the values from REST API. And in REST API you should pass selected values to API while making ADF pipeline run call.

    Please check below documentation of ADF REST APIs.

    https://learn.microsoft.com/en-us/rest/api/datafactory/pipelines

    Hope this helps. Please let me know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well. Thank you.


1 additional answer

Sort by: Most helpful
  1. RevelinoB 3,675 Reputation points
    2023-07-07T06:10:28.2433333+00:00

    Hi Ravindra,

    Yes, Azure Data Factory (ADF) provides support for parameterizing and passing values to activities, including passing values to Databricks notebooks. You can achieve the scenario you described by using parameters and expressions in ADF.

    Here's how you can implement it:

    • Define a parameter in your ADF pipeline to capture the user's fruit selection. Let's call it SelectedFruits. Set the type of the parameter to Array.
    • Create a dataset that contains the list of fruits (e.g., Apple, Banana, Papaya, Orange). This dataset can be an input dataset or a linked service.

    Configure the activity in your ADF pipeline (such as Databricks notebook activity) to use the SelectedFruits parameter as a filter. You can use the @activity('PreviousActivityName').output.value expression to reference the output of a previous activity and pass it as a parameter value.

    • In your Databricks notebook, you can access the selected fruits using the dbutils.widgets.get method. You can retrieve the parameter value using dbutils.widgets.get('SelectedFruits').

    Make sure you specify the appropriate paths and names for your Databricks notebook and linked service.

    By using this approach, the user can select one or more fruits as parameters in the ADF pipeline, and the selected fruits will be passed to the Databricks notebook for further processing.

    I hope this helps?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.