msbuild - 使用 VSTS 将 Azure Function 发布到 Zip 文件

标签 msbuild azure-functions azure-pipelines

我正在尝试使用 VSTS 发布包含 Azure Function 的项目。我的 MSBuild 步骤是传递以下构建参数

/p:Configuration=Release /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\MyFunctions.$(Build.BuildNumber)-dev.zip" /p:DeployIisAppPath="Default Web Site"

这给了我一个 Zip,其中文件夹结构为 \Content\D_C\a\3\s\MyFunctions\obj\Release\net461\PubTmp\Out 。 Out 目录包含我需要的内容以及我期望成为根目录的内容

我需要推送 Zip 的文件夹结构是

enter image description here

据记录Here

任何人都可以建议我在这里做错了什么吗?

谢谢

最佳答案

我分两步完成

  1. 使用带有设置的 VSTS 构建任务进行构建 /p:DeployOnBuild=true/p:DeployTarget=Package;CreatePackageOnPublish=true
  2. 使用 VSTS 存档文件任务对其进行压缩。在这里,我未选中前缀根文件夹名称...选项。

示例: sample Archive files task

关于msbuild - 使用 VSTS 将 Azure Function 发布到 Zip 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50365518/

相关文章:

c# - 非 Web 项目的 XML 序列化程序集

azure-functions - 如何在本地运行 Azure 函数时获取日志?

azure - 如何在Azure Function中保存状态(廉价的方式)?

当 targetType : filePath 时, azure 管道模板无法找到脚本

Azure Pipelines "Require Template"检查不起作用

c++ - VS2015 的多处理器编译在运行 cl.exe 时产生 "not enough quota is available to process this command"

visual-studio - 在 x86 和 x64 机器上使用 Hintpath

visual-studio-2010 - 发布时未执行 wpp.targets 中的 setAcl - Web 部署(但说是)

node.js - Azure Functions 是否在冷启动时运行 NPM 安装?

azure - 如何获取从 Azure Devops/VSTS/TFS 中的 "Windows Machine File Copy"任务复制的文件总数?