简体   繁体   中英

Deploying .NET core code to AWS lambda with Azure Devops - project path not found

I'm trying to run a .Net Core application in AWS Lambda, and I am struggling to get continuous deployment from Azure Pipelines working.

I have created an empty .Net Core lambda project using the AWS tooling for Visual Studio, and setup a build using the recommended ".net desktop" build pipeline in azure devops. The yaml code can be see here:

# .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)'

(I have removed the mstest task as my project doesn't contain any unit tests)

This pipeline builds successfully.

I then run a release pipeline, using the build from the previous pipeline and set to deploy on each new build. The release pipeline contains "AWS Lambda .NET Core Deployment" task, set up with my AWS lambda account. I select the linked artifacts/_lambdatest (build) folder (where lambdatest is the name of my project) and when deployed, the release gets the error message:

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

What can I do to try and get this working? I think that the issue is where the "Path to lambda project" is pointing to, but I can't figure out where else the project could be?

judging by this build pipeline, you need to publish build artifacts to be able to access them:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM