问题
How do I pass in parameters at runtime to a Linked Service in Data Factory?
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.
Pipeline
{
"name": "myActivity",
"type": "AzureFunctionActivity",
"typeProperties": {
"functionName": "myFunctionName",
"method": "POST"
}
"linkedServiceName": {
"referenceName": "myFunctionLinkedService",
"type": "LinkedServiceReference"
}
}
Linked service
{
"name": "myFunctionLinkedService",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"type": "AzureFunction",
"typeProperties": {
"functionAppUrl": "https://@{linkedService().functionAlias}.azurewebsites.net",
"encryptedCredential": ""
},
"parameters": {
"functionAlias": {
"type": "String"
}
}
}
}
回答1:
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.
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.
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)
You could submit feedback or contact ADF team directly to verify that.
来源:https://stackoverflow.com/questions/54076004/setting-a-linked-service-parameter-at-runtime-in-a-data-factory-pipeline