Hi Smithila Dandina,
Thanks for reaching out to Microsoft Q&A.
Approach 1:
To work around the lack of script parameter support in the new Script Activity in ADF, you can pass parameters dynamically using expressions to construct the SQL command with the desired parameters directly in the activity. Here’s a way to handle it:
- Create a Dynamic SQL Statement: In the Script Activity, construct the SQL command by concatenating the parameter values using ADF expressions. For example
EXECUTE PROCEDURE my_stored_procedure('${myParameter1}', '${myParameter2}')
- Use Pipeline Variables: Define the parameters as pipeline variables (e.g.,
myParameter1,myParameter2). In the Script Activity, reference these parameters dynamically within your SQL script using@concat. - Build the Script Dynamically:
- in the SQL statement field of the Script Activity, use the
@concatexpression to build the command:@concat('EXECUTE PROCEDURE my_stored_procedure('', pipeline().parameters.myParameter1, '', '', pipeline().parameters.myParameter2, '')')
- in the SQL statement field of the Script Activity, use the
- Pass Parameters to Script: If these parameters are dynamically provided, ensure they are set as pipeline parameters or variables that are accessible within the Script Activity.
Approach 2:
You can pass parameters dynamically to your Snowflake stored procedure by using Azure Functions as an intermediary layer.
Here's highlevel approach:
Create an Azure Function: Set up an Azure Function that will be triggered by your ADF pipeline.
Pass Parameters: Use the parameters from your ADF pipeline to pass them to the Azure Function.
Call Stored Procedure: In the Azure Function, use the parameters to call your Snowflake stored procedure.
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.