Setting a Linked Service parameter at runtime in a Data Factory pipeline

时光毁灭记忆、已成空白 提交于 2020-07-09 12:51:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!