aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

Cannot deploy .Net Core lambda/Serverless applications via Azure DevOps with Ubuntu Image

Open BrycePC opened this issue 6 years ago • 10 comments

I believe this may be a duplicate of #259; which was closed but the issue still remains.

When attempting to install a .Net Core serverless application via Azure DevOps (hosted agent) the following error is returned:

[command]/usr/bin/dotnet tool install -g Amazon.Lambda.Tools Tool 'amazon.lambda.tools' is already installed. [command]/usr/bin/dotnet tool update -g Amazon.Lambda.Tools Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '3.3.0'). [command]/usr/bin/dotnet restore Restore completed in 47.68 ms for /home/vsts/work/1/s/src/Organisation/Organisation.csproj. Beginning Serverless Deployment [command]/usr/bin/dotnet lambda deploy-serverless --stack-name IAOrganisation --region ap-southeast-2 --s3-bucket appdeploy-ap-southeast-2-802889573143-dev --s3-prefix iaorganisation --disable-interactive true No executable found matching command "dotnet-lambda" ##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1 ##[section]Finishing: LambdaNETCoreDeploy

Expected behavior The .Net Core application is deployed to AWS as a Lambda function

Screenshots

Your Environment

  • Azure Devops (cloud based?:
  • VSTS or Azure Devops version:
  • AWS VSTS Tools version: 1.5.0 (Latest)

image

BrycePC avatar Sep 15 '19 00:09 BrycePC

To confirm this is on a Linux build machine? What image did you select?

hunterwerlla avatar Sep 16 '19 14:09 hunterwerlla

Hi, apologies for the slow response, The depoyments are working for me now. It was my first time using the newer Azure Pipelines for .Net Core with Yaml and a hosted agent - the yaml config had defaulted to use 'unbuntu-latest' for its pool/vmImage. It works after changing this to 'windows-latest'.

Thanks,

Bryce

BrycePC avatar Sep 21 '19 04:09 BrycePC

Hm, that should work fine (and works on our test Azure Devops instance). I'll see if I can reproduce it with different settings and arked as a bug.

hunterwerlla avatar Sep 21 '19 04:09 hunterwerlla

I've reproduced this phenomenon, then I used the following script as a workaround.


- script: dotnet tool install -g Amazon.Lambda.Tools
  displayName: Prepare the lambda environment

- script: |
    $(HOME)/.dotnet/tools/dotnet-lambda deploy-function --aws-access-key-id ${AWS_ACCESS_KEY} --aws-secret-key ${AWS_SECRET_KEY} --region ${LAMBDA_RESION} --fn ${LAMBDA_NAME} -fh ${LAMBDA_FUNC} --function-runtime ${LAMBDA_RUNTIME} --project-location ${PROJECT_LOCATION}
  displayName: Deploy Lambda

mantaroh avatar Oct 11 '19 04:10 mantaroh

is it going to be fixed?

Mikilll94 avatar Oct 12 '19 19:10 Mikilll94

I have not been able to reproduce the issue, if someone has more details about the image they are using to build that would be helpful.

hunterwerlla avatar Oct 14 '19 15:10 hunterwerlla

I'm getting the same issue when trying to build with Hosted ubuntu 16-04. It works fine in a win 2019 image.

aguschirico avatar Dec 02 '19 20:12 aguschirico

I'm also having the same issue with Ubuntu

plittlewood-rpt avatar Dec 03 '19 15:12 plittlewood-rpt

The same problem out there.

Works fine with win2019 - correct local path is used:

C:\Users\VssAdministrator\.dotnet\tools\dotnet-lambda.exe

Invalid global path is used on ubuntu image:

/usr/bin/dotnet lambda 

kolomiets avatar May 07 '20 17:05 kolomiets

Same problem still in place almost a year after it was raised. dotnet lambda deploy-serverless cannot be found on 'ubuntu-latest' Azure-hosted agent. Works fine with 'windows-latest' however it ought to work on linux agents as well

gpomykala avatar Jul 09 '20 09:07 gpomykala