I have created a WebApi project and deployed this as a serverless application to AWS Lambda. It all works fine except that for one method, I need to read from a file. I can see that this file is deployed as it's in the zip file that gets pushed up but for some reason, when I come to read from it in the code, it can't find it.
I've tried both embedded resource and content for build action but neither seem to work. Is there something in AWS that needs configuring so that my serverless application can access local files?
Directory.GetCurrentDirectory()and theLAMBDA_TASK_ROOTnative environment variable to get the path to the file but neither seem to work.Directory.GetCurrentDirectory()and used a relative path and it works. Thanks for your help.