如何将Azure函数的入口点放在.NET DLL中?

Azure Functions示例说明了如何将进程入口点放在C#脚本文件.csx 。 但是,如何使用常规C#库(DLL)来实现此行为? 我可以让Kudu首先编译库,就像为Webapp做的那样吗?

截至撰写此问题时,它不受支持,但现在却是!

https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions

来自wiki的摘录:

 { "scriptFile": "PreCompiledFunctionSample.dll", "entryPoint": "PreCompiledFunctionSample.MyFunction.Run", "bindings": [ { "authLevel": "function", "name": "req", "type": "httpTrigger", "direction": "in" }, { "name": "$return", "type": "http", "direction": "out" } ], "disabled": false } 

乔安妮斯,

目前不支持此function,但您可以使用此处所述的函数发布程序集,只需让函数入口点调用程序集中的相应方法:

 #r "MyAssembly.dll" public static void Run(/*...args...*/) { MyAssembly.MyMethod(/*..args...*/); }