admin管理员组

文章数量:1318563

I have 2 notebooks in synapse. 1- With general code 2- With functions where I trying to connect to the blob service and one data base.

I'm trying to do the following from my main notebook:

blob_service_client, account_name = mssparkutils.notebook.run('Common/Functions_Utils', timeout_seconds=60, arguments={  
                                                                                                    'function_name': 'get_blob_service_client',
                                                                                                    'kv_name':kv_name, 
                                                                                                    'account_name':account_name, 
                                                                                                    'account_key':account_key})

session, engine = mssparkutils.notebook.run('Common/Functions_Utils', timeout_seconds=60, arguments={
                                                                                                        'function_name': 'get_bd_connection',
                                                                                                        'kv_name': kv_name,
                                                                                                        'server_name': server_name,
                                                                                                        'user_name': user_name,
                                                                                                        'password_name': password_name,
                                                                                                        'database_name': database_name
                                                                                                        })

How I get the arguments in my Functions_Utils notebook to chose the function I want to run?

I have 2 notebooks in synapse. 1- With general code 2- With functions where I trying to connect to the blob service and one data base.

I'm trying to do the following from my main notebook:

blob_service_client, account_name = mssparkutils.notebook.run('Common/Functions_Utils', timeout_seconds=60, arguments={  
                                                                                                    'function_name': 'get_blob_service_client',
                                                                                                    'kv_name':kv_name, 
                                                                                                    'account_name':account_name, 
                                                                                                    'account_key':account_key})

session, engine = mssparkutils.notebook.run('Common/Functions_Utils', timeout_seconds=60, arguments={
                                                                                                        'function_name': 'get_bd_connection',
                                                                                                        'kv_name': kv_name,
                                                                                                        'server_name': server_name,
                                                                                                        'user_name': user_name,
                                                                                                        'password_name': password_name,
                                                                                                        'database_name': database_name
                                                                                                        })

How I get the arguments in my Functions_Utils notebook to chose the function I want to run?

Share Improve this question edited Jan 21 at 11:01 JayashankarGS 8,2102 gold badges3 silver badges12 bronze badges Recognized by Microsoft Azure Collective asked Jan 21 at 10:50 David MolinaDavid Molina 1611 silver badge7 bronze badges 1
  • check mssparkutils methods. it has util to get args i guess – JayashankarGS Commented Jan 21 at 10:59
Add a comment  | 

1 Answer 1

Reset to default 0

You need to just define it in parameter cell,check this example.

In your case you define the parameters in the cell of you notebook Common/Functions_Utils like below.

function_name ='default_values'
kv_name = "default_value_kv_name"
server_name = "default_values_server_name"
user_name = "default_values_user_name"
password_name = "default_values_password_name"
database_name = "default_values_database_name"
account_name = "default_values_account_name"
account_key = "default_values_account_key"

and access them directly like below.

mssparkutils.notebook.exit(value=function_name)

Output:

本文标签: azureMultiple functions in notebook using mssparkutilnotebookrunStack Overflow