【问题标题】:Deploying .NET core code to AWS lambda with Azure Devops - project path not found使用 Azure Devops 将 .NET 核心代码部署到 AWS lambda - 找不到项目路径
【发布时间】:2019-06-17 13:33:36
【问题描述】:

我正在尝试在 AWS Lambda 中运行 .Net Core 应用程序,并且我正在努力通过 Azure Pipelines 进行持续部署。

我使用适用于 Visual Studio 的 AWS 工具创建了一个空的 .Net Core lambda 项目,并在 azure devops 中使用推荐的“.net desktop”构建管道设置了构建。 yaml代码可以看这里:

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'VS2017-Win2016'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@0

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

(我已经删除了 mstest 任务,因为我的项目不包含任何单元测试)

此管道已成功构建。

然后我运行一个发布管道,使用前一个管道中的构建并设置为在每个新构建上进行部署。发布管道包含使用我的 AWS lambda 帐户设置的“AWS Lambda .NET Core 部署”任务。我选择链接的 artifacts/_lambdatest (build) 文件夹(其中 lambdatest 是我的项目的名称),部署时,发布会收到错误消息:

2019-01-23T21:33:45.1791634Z ##[error]Unhandled: Not found lambdaProjectPath: D:\a\r1\a\_lambdatest

我可以做些什么来尝试让它工作?我认为问题出在“通往 lambda 项目的路径”所指的位置,但我不知道该项目可能在哪里?

【问题讨论】:

    标签: amazon-web-services azure .net-core azure-devops azure-pipelines-release-pipeline


    【解决方案1】:

    从这个构建管道来看,您需要发布构建工件才能访问它们:

    - task: PublishBuildArtifacts@1
      inputs:
        pathtoPublish: '$(Build.Repository.LocalPath)/path/to/artifacts'
        artifactName: 'artifact' 
        publishLocation: 'Container'
      condition: always()
    

    【讨论】:

      猜你喜欢
      • 2020-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多