aws / aws/aws-toolkit-azure-devops

Issue building .Net Core 3.1 Package - (potential issues with the home directory?)

Open
#350 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
258
Forks
114
PR merge metrics
No merged PRs in 30d

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

Contributor guide

Open the contributing guide

Research direction

Start with the LambdaNETCoreDeploy@1 task and the package-only command shown in the pipeline logs. Reproduce the Azure DevOps build and inspect whether the installed Amazon Lambda Tools executable is available to /usr/bin/dotnet; done means the package-only deployment creates the serverless.template successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, azure
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.