我正在尝试设置第一个管道以将 Web 应用程序部署到 Azure 应用程序服务。我可以通过 Visual Studio 手动发布该网站,但现在我尝试从 Azure Repo 构建和部署它。构建部分工作正常且没有错误。当我添加部署任务时,问题就出现了。部署任务似乎无法找到要部署的文件。
##[debug]Exit code 0 received from tool 'C:\Program Files\dotnet\dotnet.exe'
##[debug]STDIO streams have closed for tool 'C:\Program Files\dotnet\dotnet.exe'
##[debug]modifyOutputPath=true
##[debug]Zip Source: D:\a\1\a\s
##[debug]Zip arguments: Source: D:\a\1\a\s , target: D:\a\1\a\s.zip
##[debug]Successfully created archive D:\a\1\a\s.zip
##[debug]rm -rf D:\a\1\a\s
##[debug]removing directory D:\a\1\a\s
发布工件部分显示以下成功消息:
File upload succeed.
Upload 'D:\a\1\a' to file container: '#/10370704/drop'
Associated artifact 541 with build 667
然后 Azure Web App 部署显示以下调试和错误消息:
##[debug]pattern: 'D:\a\1\s**.zip'
##[debug]expanding braces
##[debug]pattern: 'D:/a/1/s/**/.zip'
##[debug]applying include pattern against original list
##[debug]0 matches
##[debug]0 final results
##[debug]No matching files were found with search pattern: D:\a\1\s**.zip
##[debug]Deployment Failed with Error: Error: No package found with specified pattern: D:\a\1\s**.zip
Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
##[debug]task result: Failed
##[error]Error: No package found with specified pattern: D:\a\1\s***.zip
最佳答案
在发布 Azure Web App 之前,您可以尝试使用 powershell 任务列出文件夹中的文件。
根据您的描述,模式似乎应该是 $(Build.ArtifactStagingDirectory)/*.zip
?
关于azure-devops - Azure DevOps : Error: No package found with specified pattern: D:\a\1\s\**\*. zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69906446/