-
Notifications
You must be signed in to change notification settings - Fork 108
Description
I have recently been migrating my .Net API to Core 3.1 in order to take advantage of the ReadyToRun features for quicker cold starts in Lambda as detailed at https://aws.amazon.com/blogs/compute/announcing-aws-lambda-supports-for-net-core-3-1/.
I finished doing migrating all the code and it all builds locally and runs. I updated the task in my pipeline to be as follows.
- task: LambdaNETCoreDeploy@1
displayName: 'Create Severless API Package'
inputs:
awsCredentials: AWS
command: deployServerless
packageOnly: true
packageOutputFile: $(Build.ArtifactStagingDirectory)\serverless.template
lambdaProjectPath: path/to/project.csproj
s3Bucket: 'bucketname'
additionalArgs: '--msbuild-parameters "/p:PublishReadyToRun=true --self-contained false'
Looking in the logs, I can see the Amazon Lambda Tools are getting installed here
Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed.
You can invoke the tool using the following command: dotnet-lambda
Tool 'amazon.lambda.tools' (version '4.0.0') was successfully installed.
But then later on it fails with this error
Performing package-only build of serverless application, output template will be placed in /home/vsts/work/1/a\serverless.template
/usr/bin/dotnet lambda package-ci -ot /home/vsts/work/1/a\serverless.template --s3-bucket bucketname --disable-interactive true --msbuild-parameters /p:PublishReadyToRun=true --self-contained false
Could not execute because the specified command or file was not found.
Possible reasons for this include:
- You misspelled a built-in dotnet command.
- You intended to execute a .NET Core program, but dotnet-lambda does not exist.
- You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1