gpt4 book ai didi

azure - 错误 : No package found with specified pattern: D:\a\1\s\**\*. zip

转载 作者:行者123 更新时间:2023-12-03 05:32:18 28 4
gpt4 key购买 nike

我在通过管道将 Blazor 应用部署到 Azure Web App 服务时遇到问题。除 Azure Web 应用服务部署外,所有步骤均已通过。

enter image description here

它给了我错误:

**##[error]Error: No package found with specified pattern: D:\a\1\s\**\*.zip<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.**

这是有问题的 YAML 管道:

trigger:
- master

pool:
vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
- task: AzureWebApp@1
inputs:
azureSubscription: 'Pay-As-You-Go (********-****-****-****-************)'
appType: 'webApp'
appName: 'Xenoprovider'
package: '$(System.DefaultWorkingDirectory)/**/*.zip'
deploymentMethod: 'auto'

如果有人能提供帮助,我将不胜感激,我是一个人操作的:)

最佳答案

您在这里缺少的实际上是发布您的项目。因此,首先请删除此内容:

task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)
targetFolder: $(Build.ArtifactStagingDirectory)

您不需要复制整个源代码,然后将其发布为管道工件。

另请确保您使用正确版本的 dotnet core。您可以在csproj <TargetFramework>netcoreapp3.0</TargetFramework>中查看它然后通过下面的任务确保安装了正确的版本:

steps:
- task: UseDotNet@2
inputs:
version: '3.0.x'

然后请添加与此类似的步骤来发布您的项目(在发布管道/构建工件之前)

- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: '$(projectDirectory)\hadar.csproj'
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true

最后请确保您在此步骤中正确传递了包裹

- task: AzureWebApp@1
displayName: Azure Web App Deploy
inputs:
azureSubscription: $(azureSubscription)
appName: samplewebapp
package: $(Build.ArtifactStagingDirectory)/**/*.zip

请注意,这样您就不需要复制步骤,因为您发布到 $(Build.ArtifactStagingDirectory)然后您在 $(Build.ArtifactStagingDirectory) 中查找要发布的包而不是 $(System.DefaultWorkingDirectory)

关于azure - 错误 : No package found with specified pattern: D:\a\1\s\**\*. zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64569646/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com