You can implement an Azure Function that accepts a list of consumer IDs and returns a query or a list that can be used to filter the"consumer_master_bills data.
You can write it in C#, JavaScript, or Python (the language yourself comfortble) and it would generate a SQL query (or a filter condition) based on your input.
Then make sure your Azure Function exposes an HTTP endpoint that accepts a payload with consumer IDs and returns a suitable query string or filter criteria.
How to integrate it with Azure Data Factory ?
Use a Web Activity in Azure Data Factory to call your Azure Function. Pass the list of consumer IDs from consumer_pred as the input to this Azure Function.
You can store the output of the first Copy Data Activity in a variable or a database/table, then pass this data to the Web Activity.
The output of the Azure Function should be captured in a variable within your Data Factory pipeline.
How to use the Dynamic Content in Copy Data Activity ?
In the Source settings of your consumer_master_bills Copy Data Activity, use dynamic content to incorporate the filter query or condition.
This would typically be done in the query option of the source dataset if you're dealing with SQL sources, or in the dataset expression if it's a non-SQL source.
Then you use the variable that holds the Azure Function output as the filter condition in your query. For example, if you're querying a SQL database, your source dataset query might look something like SELECT * FROM consumer_master_bills WHERE ConsumerID IN (@filterCriteria)
, where @filterCriteria
is dynamically populated from the Azure Function's output.