azure-devops - Azure DevOps : Error: No package found with specified pattern: D:\a\1\s\**\*. zip

标签 azure-devops azure-pipelines

我正在尝试设置第一个管道以将 Web 应用程序部署到 Azure 应用程序服务。我可以通过 Visual Studio 手动发布该网站,但现在我尝试从 Azure Repo 构建和部署它。构建部分工作正常且没有错误。当我添加部署任务时,问题就出现了。部署任务似乎无法找到要部署的文件。

我的管道 enter image description here

我的发布配置: enter image description here 在我的管道中,发布部分显示以下调试信息:

##[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

发布工件配置部分: enter image description here

发布工件部分显示以下成功消息:

File upload succeed.
Upload 'D:\a\1\a' to file container: '#/10370704/drop'
Associated artifact 541 with build 667

Web 部署配置如下所示: enter image description here

然后 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/

相关文章:

Azure DevOps如何获取任务中的安全变量值

Azure DevOps 使用 yaml 文件构建管道不起作用

azure - 根据条件设置Azure参数值

Azure DevOps 发布错误 "Microsoft.TeamFoundation.DistributedTask.Pipelines.PipelineValidationException (type ReleaseManagementHandledException)"

azure-devops - 如何将测试用例从 Excel 导入到 VSTS/Azure DevOps

azure - 使用 powershell 获取 Azure DevOps 服务连接服务主体 ID

c# - 无需用户即可访问 Azure DevOps API

azure-devops - 在 Azure DevOps 管道中的“测试”选项卡上对测试结果进行排序

azure - 复制前删除 Azure Blob 内容

visual-studio-2015 - TFS 2015在一个目录中发布构建工件