Hi,
Working with AWS and C#.
I have a working Lambda function in two stages, dev and prod. Both work fine if I remove them and redeploy them entirely. However, obviously I don’t want to change my endpoint every time there’s a change, so I was trying to deploy just the function itself, and encountered a problem. Serverless tells me it packaged, uploaded, and successfully deployed the function, but when I try to invoke it, I get the following error:
"Could not find the specified handler assembly with the file name '/var/task/CsharpHandlers.dll' or '/var/task/CsharpHandlers.ni.dll'. The assembly should be located in the root of your uploaded .zip file."
I re-ran the build and tried again, same issue. Removed and redeployed and it works. Tried to update just the function again, same issue. I swear it worked before I separated things into stages, so I think it’s related to that. Google yields zero page results, so I’m either a member of the red team or a fool. Please enlighten me as to which.
My .yml below:
service: email-event
provider:
name: aws
runtime: dotnetcore1.0
environment:
dev_SVCURL: "https://dev.mydomain.com/svc/api"
prod_SVCURL: "https://app.mydomain.com/svc/api"
package:
artifact: bin/release/netcoreapp1.0/deploy-package.zip
functions:
handle:
handler: CsharpHandlers::MyNamespace.EmailEvent.Handler::Handle
events:
- http:
path: endpoint
method: post
integration: lambda
request:
template:
application/json: '{ "xApiKey": "$input.params(''x-api-key'')", "svcUrl": "${self:provider.environment.${opt:stage}_SVCURL}", "body": $input.json(''$'') }'