首页 > 解决方案 > 如何使用输入参数在 azure data factory 中运行 exe 文件?

问题描述

我有一个控制台应用程序。我构建了这个应用程序并将其上传到 Azure blob 存储。然后我运行这个应用程序 Azure 数据工厂管道。一切都很好,但问题是如果我想向控制台应用程序添加新参数(获取输入)我该怎么做?有什么具体的方法吗?

 {
    "name": "samplebatch",
    "type": "Custom",
    "policy": {
        "timeout": "7.00:00:00",
        "retry": 0,
        "retryIntervalInSeconds": 30,
        "secureOutput": false
    },    
"typeProperties": {
        "command": "SampleApp.exe",
        "folderPath": "customactv2/SampleApp",
        "resourceLinkedService": {
          "referenceName": "StorageLinkedService",
          "type": "LinkedServiceReference"
        }
   "linkedServiceName": {
        "referenceName": "dataloadbatchservice",
        "type": "LinkedServiceReference"
    }
}

这是我迄今为止在数据工厂管道代码中所做的。

标签: c#azureazure-blob-storageazure-data-factory

解决方案


请参考 中的extendedProperties属性typeProperties,您可以使用它。

可以以 JSON 格式传递给自定义应用程序的用户定义属性,以便您的自定义代码可以引用其他属性

文档:https ://docs.microsoft.com/en-us/azure/data-factory/transform-data-using-dotnet-custom-activity#custom-activity

示例:https ://github.com/Azure/Azure-DataFactory/blob/master/Samples/ADFv2CustomActivitySample/MyCustomActivityPipeline.json


推荐阅读