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
1 Answer
Reset to default 0You 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
版权声明:本文标题:azure - Multiple functions in notebook using mssparkutil.notebook.run - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742048492a2417934.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论