Azure函数返回错误:未找到作业函数.尝试公开您的工作类别和方法 [英] Azure function returns error: No job functions found. Try making your job classes and methods public

查看:58
本文介绍了Azure函数返回错误:未找到作业函数.尝试公开您的工作类别和方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have created an Azure Function application in Visual Studio 2017 and can publish it to Azure without any issues using the Visual Studio publish functionality (right click project then select Publish).

由于从Visual Studio的开发人员实例进行部署不是理想的持续集成策略,因此我使用TeamCity和Octopus创建了一个部署管道,其中TeamCity构建Azure功能应用程序,而Octopus使用

As deploying from a developers instance of Visual Studio isn't an ideal continuous integration strategy, I have created a deployment pipeline with TeamCity and Octopus where TeamCity builds the Azure function application and Octopus uses the WAWSDeploy application to deploy the Azure Function files to Azure. The deployment works fine and I when I view the Azure function files when deployed via WAWSDeploy, the files are exactly the same as when I publish the Azure Function application from Visual Studio.

但是从WAWSDeploy部署(通过查看Azure Function应用程序日志)时,出现错误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..这似乎不是WAWSDeploy问题,但看起来Visual Studio的发布功能正在做我所缺少的事情.有什么想法吗?

However I get the errors No job functions found. Try making your job classes and methods public. and Invalid script file name configuration. The 'scriptFile' property is set to a file that does not exist. when I deploy (by viewing the Azure Function application logs) from WAWSDeploy. This doesn't appear to be a WAWSDeploy issue but it looks like the Visual Studio publish function is doing something I'm missing. Any ideas?

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

Folder structure of Azure function files:

推荐答案

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

Issue was caused by having an incorrect scriptFile value in the function.json file. When I published the Azure function from Visual Studio, this value is set correctly but when I build the Azure function and push the files to the Azure function application manually, the scriptFile value is missing the bin folder in the path to my function dll file. During my build process, I now hack the scriptFile value to set it correctly.

这篇关于Azure函数返回错误:未找到作业函数.尝试公开您的工作类别和方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆