Azure函数未显示在门户网站的Function应用程序中 [英] Azure Functions not showing up in Function app in portal

查看:92
本文介绍了Azure函数未显示在门户网站的Function应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含Web应用程序和类库的解决方案.我为此添加了两个Azure功能项目,第一个是版本1,第二个是版本2.两者在本地都可以正常运行.该代码位于在线存储库(Visual Studio Online,现在为Azure DevOps)中,我将其从持续部署设置为在门户中设置的Azure功能.但是,尽管像Azure网站一样成功部署了代码,并且URL显示您的Function App已启动并正在运行",但是两个项目都未显示在门户网站的Functions下.我正在使用Visual Studio 2017.

I've got a solution that contains a web app and class libraries. I added two Azure function projects to this, the first is version 1 and the second version 2. Both run fine locally. This code is in an online repository (Visual Studio Online, now Azure DevOps), and I set up continuous deployment from it to an Azure function set up in the portal. However, neither project is showing up under Functions in the portal although the code deployed successfully just like Azure websites and the URL says "Your Function App is up and running". I'm using Visual Studio 2017.

推荐答案

如果您没有设法使CD正常工作,这就是窍门.您提到您正在使用Runtime V2(.NET CORE).我也有一些在CI/CD中设置的功能.在Build Pipeline使用dotnet Build Task构建您的功能项目中,并仅使用Function项目路径将其指向.

If you have'nt managed to get CD working, here's the trick. You mentioned that you are using Runtime V2 (.NET CORE ). I have some functions setup in CI/CD as well. In the Build Pipeline Build you function project with dotnet Build Task and point it with only the Function project path.

然后在任务的参数中添加 /p:DeployOnBuild=true /p:DeployTarget=Package;CreatePackageOnPublish=true

And in the arguments of the task add this /p:DeployOnBuild=true /p:DeployTarget=Package;CreatePackageOnPublish=true

构建任务之后,默认情况下使用Publish Artifact任务,它将输出输出到$(Build.ArtifactStagingDirectory)

After the build task, use the Publish Artifact task by default it outputs eveything to $(Build.ArtifactStagingDirectory)

现在是最后一步.使用Azure App Service Deploy任务,并使用您的凭据(例如,subscription,RG等)进行身份验证.

Now the last step. Use the Azure App Service Deploy task and Authenticate with your credentials like subscription,RG etc.

现在在App Service Type中选择FunctionApp on Windows/Linux(您的选择)

Now in the App Service Type choose FunctionApp on Windows/Linux ( your choice)

现在在Package or Folder参数中提供$(Build.ArtifactStagingDirectory)/YourFunctionProjectName.zip

这有助于我为Azure功能设置CI/CD.

This helped me to setup CI/CD for Azure Functions.

这篇关于Azure函数未显示在门户网站的Function应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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