我正在用C#构建Azure函数,并希望使用管道进行部署. 我做了一次,测试,然后发布. 然后,对于每个ENV,我运行一个bicep文件来设置基础设施,并在我希望将发布的Function Code部署到(单个)Function App之后立即运行.
我在try 从发布的zip文件进行部署时遇到了一个错误.文件找不到了.我做错了什么?
发布文件示例:
[命令]/usr/bin/zip—r/home/vsts/work/1/s/www.example.com
(日志(log)行似乎合理)
看到的错误:
##[error]Error: No package found with specified pattern: /home/vsts/work/1/a/*.zip
Check if the package mentioned
请注意,我们从/1/s发布,并try 在/1/a中找到它
该构建具有"附加"工件,如"drop/www.example.com (11MB的文件似乎合理)
yaml线发布:
- task: DotNetCoreCLI@2
displayName: "dotnet publish"
inputs:
command: publish
arguments: '--configuration Release --output publish_output'
projects: 'src/**/*.csproj'
publishWebProjects: false
modifyOutputPath: false
zipAfterPublish: false
- task: ArchiveFiles@2
displayName: "Archive files (into zip)"
inputs:
rootFolderOrFile: "$(System.DefaultWorkingDirectory)/publish_output"
includeRootFolder: false
archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
- task: PublishBuildArtifacts@1
displayName: "Publish build artifacts"
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
YAML线部署:
- task: AzureFunctionApp@1 # Add this at the end of your file
displayName: 'Deploy Function code to FunctionApp Slot'
inputs:
azureSubscription: 'ServiceConnection'
appType: functionAppLinux # default is functionApp
appName: 'f2404dev-app'
package: '$(System.ArtifactsDirectory)/**/*.zip'