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

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

问题描述

我有一个包含 Web 应用程序和类库的解决方案.我为此添加了两个 Azure 功能项目,第一个是版本 1,第二个是版本 2.两者都在本地运行良好.此代码位于在线存储库(Visual Studio Online,现为 Azure DevOps)中,我设置了从它到门户中设置的 Azure 函数的持续部署.但是,这两个项目都没有显示在门户中的 Functions 下,尽管成功部署的代码就像 Azure 网站一样,并且 URL 显示您的 Function App 已启动并正在运行".我正在使用 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 Build your function project with 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 任务并使用您的凭据(如订阅、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

Now in the Package or Folder argument provide $(Build.ArtifactStagingDirectory)/YourFunctionProjectName.zip

这帮助我为 Azure Functions 设置 CI/CD.

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

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

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