简体   繁体   English

尝试通过 dotnet publish 命令发布 azure 函数

[英]Trying to publish an azure function via dotnet publish command

We are facing an issue while trying to deploy a function app via the dotnet publish command line.我们在尝试通过 dotnet publish 命令行部署函数应用时遇到问题。 All other apps publish successfully.所有其他应用程序发布成功。 The only difference is that this is a function app while the others are app services.唯一的区别是这是一个功能应用程序,而其他是应用程序服务。

This is the pubxml:这是 pubxml:

公共XML

This is the command:这是命令:

命令

and this is the outcome:这是结果:

结果

It seems it builds the project but never uploads it.它似乎构建了项目,但从未上传过它。

Any help please?请问有什么帮助吗?

Thank you Andy posting your suggestion as an answer to help other community members.感谢安迪发布您的建议作为帮助其他社区成员的答案。

"I have an MSBuild command line that is working to deploy my .NET Core 2.1 Function project: “我有一个 MSBuild 命令行,用于部署我的 .NET Core 2.1 Function 项目:

msbuild /p:DeployOnBuild=True /p:PublishProfile=somename.pubxml /p:Configuration=Release

It is, however, worth noting the following:但是,值得注意的是以下几点:

General .NET Core publishing notes一般 .NET Core 发布说明

  1. If you miss-spell the publish profile name, it will silently skip deployment (no warning or error).如果您拼错了发布配置文件名称,它将悄悄地跳过部署(没有警告或错误)。

Differences between ASP. ASP 之间的差异。 NET Core and .NET Core Functions deployment NET Core 和 .NET Core Functions 部署

  1. If you use 'dotnet publish', it will always skip deployment.如果您使用“dotnet 发布”,它将始终跳过部署。

  2. If you don't specify /p:DeployOnBuild=True, it'll skip deployment."如果您不指定 /p:DeployOnBuild=True,它将跳过部署。”

Please refer the below link for more information: MS DOC: Create a C# function in Azure from the command line有关详细信息,请参阅以下链接:MS DOC: 从命令行在 Azure 中创建 C# 函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps Build Pipeline:“publish”命令正在执行“dotnet build”而不是“dotnet publish” - Azure DevOps Build Pipeline: 'publish' command is executing 'dotnet build' instead of 'dotnet publish' dotnet publish 不会为 Azure Functions 创建 bin 文件夹 - dotnet publish doesn't create a bin folder for Azure Functions Azure Devops 管道 do.net 发布任务忽略项目设置 - Azure Devops Pipelines dotnet publish task ignores projects setting 如何通过 do.net publish 将预处理器指令传递给 MSBuild - How to pass preprocessor directive to MSBuild via dotnet publish 我可以使用 dotnet publish 命令来构建 .NET Framework 应用程序吗? - Can I use dotnet publish command to build .NET Framework applications? 使用 dotnet publish 发布多个 web.configs - Publish multiple web.configs with dotnet publish Azure功能发布失败错误消息 - Azure Function Publish failed error message dotnet 发布命令不适用于 aws buildspecs.yml 文件中的 asp dotnet 项目 - dotnet publish command not working with asp dotnet project in aws buildspecs.yml file dotnet 在代理 407 后面发布 - dotnet publish behind proxy 407 找不到 Docker dotnet 发布输出 - Docker dotnet publish output not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM