首页 文章

Azure函数返回错误:找不到作业函数 . 尝试公开您的工作类和方法

提问于
浏览
1

我在Visual Studio 2017中创建了一个Azure Function应用程序,可以使用Visual Studio发布功能将其发布到Azure而没有任何问题(右键单击项目,然后选择发布) .

由于从Visual Studio的开发人员实例部署不是理想的持续集成策略,我已经创建了TeamCity和Octopus的部署管道,其中TeamCity构建Azure功能应用程序,Octopus使用WAWSDeploy应用程序将Azure功能文件部署到Azure . 部署工作正常,当我通过WAWSDeploy部署时查看Azure功能文件时,文件与我从Visual Studio发布Azure功能应用程序时的文件完全相同 .

但是,当我从WAWSDeploy部署(通过查看Azure功能应用程序日志)时,我收到错误 No job functions found. Try making your job classes and methods public.Invalid script file name configuration. The 'scriptFile' property is set to a file that does not exist. . 这个没有't appear to be a WAWSDeploy issue but it looks like the Visual Studio publish function is doing something I'失踪 . 有任何想法吗?

Azure功能文件的文件夹结构:

enter image description here

1 回答

  • 1

    问题是由于 function.json 文件中的 scriptFile 值不正确引起的 . 当我从Visual Studio发布Azure功能时,此值设置正确但是当我构建Azure功能并手动将文件推送到Azure功能应用程序时, scriptFile 值缺少我的函数dll文件路径中的 bin 文件夹 . 在我的构建过程中,我现在破解 scriptFile 值以正确设置它 .

相关问题