Azure CD 管道找不到构建工件

Azure CD pipeline can't find build artifacts

下面是来自 Azure 发布管道的 Azure 错误日志。

2020-07-24T05:17:13.7712974Z ##[section]Starting: Deploy Azure App Service
2020-07-24T05:17:14.0464143Z ==============================================================================
2020-07-24T05:17:14.0465719Z Task         : Azure App Service deploy
2020-07-24T05:17:14.0469391Z Description  : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2020-07-24T05:17:14.0469849Z Version      : 3.163.5
2020-07-24T05:17:14.0470410Z Author       : Microsoft Corporation
2020-07-24T05:17:14.0470921Z Help         : https://aka.ms/azureappservicetroubleshooting
2020-07-24T05:17:14.0471274Z =============================================================================
2020-07-24T05:17:16.0650643Z Got connection details for Azure App Service:'XXXXX'
2020-07-24T05:17:17.6576087Z (node:764) Warning: Use Cipheriv for counter mode of aes-256-ctr
**2020-07-24T05:17:17.6627737Z ##[error]Error: No package found with specified pattern: D:\a\r1\a\Drop<br/>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.**
2020-07-24T05:17:22.9168975Z Successfully added release annotation to the Application Insight : XXXXX
2020-07-24T05:17:24.8686063Z Successfully updated deployment History at https://XXXXX.scm.azurewebsites.net/api/deployments/231595567842919
2020-07-24T05:17:24.8933576Z ##[section]Finishing: Deploy Azure App Service

P.S。我检查了构建管道,我可以下载构建 Artificats,但它显示在警告下方。

[警告]目录 'D:\a\a' 为空。不会添加任何内容来构建工件 'drop'.

作为任务“Publish Build Artifact”从 $(build.artifactstagingdirectory) 发布工件,因此我们需要添加一个任务“Copy files”来将您的文件**从 $(system.defaultworkingdirectory) 复制到$(build.artifactstagingdirectory) **。它将我的构建复制到暂存目录。

假设您的意思是您已经解决了构建工件空问题,但发布管道在 Azure App Service deploy 任务中仍然存在问题。

正如所提到的错误,有“没有找到具有指定模式的包:D:\a\r1\a\Drop”,你需要检查你是如何定义的,试试格式 $(System.DefaultWorkingDirectory)/**/*.zip 而不是 $(System.DefaultWorkingDirectory)\Drop.