Azure Functions 示例说明了如何将进程入口点放在 C# 脚本文件中.csx
。但是,如何使用常规 C# 库 (DLL) 来实现该行为?我可以让 Kudu 像为 Webapp 所做的那样首先编译库吗?
问问题
1392 次
2 回答
4
乔安妮斯,
目前不支持此功能,但您可以使用此处描述的函数发布程序集,只需让函数入口点调用程序集中的适当方法:
#r "MyAssembly.dll"
public static void Run(/*...args...*/)
{
MyAssembly.MyMethod(/*..args...*/);
}
于 2016-04-12T18:14:26.110 回答
2
在撰写此问题时,它不受支持,但现在支持!
https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions
维基摘录:
{
"scriptFile": "PreCompiledFunctionSample.dll",
"entryPoint": "PreCompiledFunctionSample.MyFunction.Run",
"bindings": [
{
"authLevel": "function",
"name": "req",
"type": "httpTrigger",
"direction": "in"
},
{
"name": "$return",
"type": "http",
"direction": "out"
}
],
"disabled": false
}
于 2017-01-11T19:09:47.820 回答