问题描述
如何在运行时将参数传递给Data Factory中的链接服务?
How do I pass in parameters at runtime to a Linked Service in Data Factory?
我在Azure函数链接服务定义中定义并使用了一个参数,但是不确定如何在管道操作的调用过程中设置该参数.在这种情况下,我想在触发器中设置functionAlias来设置Azure Function主机名.当前,(blob创建)触发器返回了一个异常,指出未指定functionAlias.
I have a parameter defined and consumed in my Azure Function linked service definition, but am unsure how I set that during invocation in my pipeline action. In this case I would like to set functionAlias in a trigger to set the Azure Function hostname. Currently an exception is returned on (blob create) trigger stating that functionAlias is not specified.
管道
{
"name": "myActivity",
"type": "AzureFunctionActivity",
"typeProperties": {
"functionName": "myFunctionName",
"method": "POST"
}
"linkedServiceName": {
"referenceName": "myFunctionLinkedService",
"type": "LinkedServiceReference"
}
}
链接服务
{
"name": "myFunctionLinkedService",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"type": "AzureFunction",
"typeProperties": {
"functionAppUrl": "https://@{linkedService().functionAlias}.azurewebsites.net",
"encryptedCredential": ""
},
"parameters": {
"functionAlias": {
"type": "String"
}
}
}
}
推荐答案
我试图在Data Factory UI中对Azure函数链接服务进行参数化,并得到与您相同的错误,因为参数输入框从未出现过.
I tried to parameterize Azure Function Linked Service in the Data Factory UI and get the same error as same as you because the parameter input box did not show up ever.
然后,我按照官方文档尝试对Azure SQL数据库链接服务进行参数化.
Then I follow the official document to try to parameterize Azure SQL Database Linked Service.
然后我对其进行测试,并按预期显示输入框.
Then I test it and the input box showed up just as I expected.
我检查了文档并找到以下声明.
I check the document and find the below statement.
到目前为止,似乎ADF中的参数化功能仅支持数据存储,但是Azure函数属于Compute
,不属于数据存储.(也许将来会支持)
It seems that only data stores are supported by parameterize feature in ADF so far, however Azure Function is belong to Compute
,not data stores.(Maybe it will be supported in the furture)
您可以提交反馈或直接与ADF团队联系以进行验证.
You could submit feedback or contact ADF team directly to verify that.
这篇关于在运行时在Data Factory管道中设置链接服务参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!