Forum Discussion
user data functions + deployment pipeline, no variables ?
- 1 year ago
Hi Jerome22
You can use Varaiable Libraires in data pipelines(preview mode) Read more about variable libraries here Learn how to use Variable libraries - Microsoft Fabric | Microsoft Learn
But, while coming to UDF, as of now UDF's not supported to use direct access to Variable libraries inside UDF. As a work around you can use notebook that reads the values from variable library and it passes the values to the UDF as parameters. Then you can use the parameters to setup your conenctions dynamically. Just give a try.
Pls read this blog User data functions source control and deployment - Microsoft Fabric | Microsoft Learn it may helps you
Please let me know if it works.
Thank you!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
@udf.connection(argName="testsqlDB", alias="testsqldb") @udf.connection(argName="prodsqlDB", alias="prodsqldb") @udf.connection(argName="envConfig", alias="environmentConf") @udf.function() def FO_Subscribe_Unsubscribe(testsqlDB: fn.FabricSqlConnection, prodsqlDB: fn.FabricSqlConnection, envConfig: fn.FabricVariablesClient, IsUserSubscribed: int, UserEmail: str, FundingOpportunityID: str, FundingOpportunity: str) -> str: # Step 1: call stored procedure that inserts or delete rows from the subscription table try: connection = get_sql_connection(envConfig,testsqlDB,prodsqlDB) cursor = connection.cursor()Since connection aliases currently appear to be static and deployment pipeline does not autobind connections, I implemented that workaround. Has anyone found a cleaner CI/CD approach for UDF connection management?