【问题标题】:No package found when deploying an Asp.Net Core application to Azure using Azure DevOps使用 Azure DevOps 将 Asp.Net Core 应用程序部署到 Azure 时未找到包
【发布时间】:2019-04-09 21:24:44
【问题描述】:

我在 Azure DevOps 中有以下发布和部署任务:

variables:
  buildConfiguration: 'Release'
  buildPlatform: 'any cpu'
  azureSubscription: 'subscription'
  azureAppType: 'Web App on Windows'
  webAppName: 'webapp'

steps:

# Other tasks

- task: DotNetCoreCLI@2
  displayName: 'Publish'
  inputs:
    command: publish
    publishWebProjects: false
    arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)'
    zipAfterPublish: true

- task: AzureRmWebAppDeployment@4
  displayName: 'Deploy'
  inputs:
    package: $(System.DefaultWorkingDirectory)/**/MyProj.zip
    azureSubscription: '$(azureSubscription)'
    appType: '$(azureAppType)'
    webAppName: '$(webAppName)'

发布任务成功,但部署任务出现错误:

[error]Error: No package found with specified pattern: /home/vsts/work/1/s/**/MyProj.zip

我做错了什么?

【问题讨论】:

    标签: asp.net-core azure-devops asp.net-core-2.0


    【解决方案1】:

    查看您的 YAML:

    您使用以下参数发布: --output $(build.artifactstagingdirectory)

    您尝试从完全不同的位置进行部署: package: $(System.DefaultWorkingDirectory)/**/MyProj.zip

    尝试部署$(build.artifactstagingdirectory)/**/MyProj.zip

    【讨论】:

    • 我试过了,但我一直收到同样的错误......有什么想法吗?
    • 如果您收到 same 错误,则说明您没有更新 YAML 文件。 $(build.artifactstagingdirectory) 将是类似/home/vsts/work/1/a/ 的路径。如果您将 that 作为路径,那么您需要查看构建输出以查看已发布文件的实际路径是什么。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-01
    相关资源
    最近更新 更多