.NET Core lambda Functions are always deployed
Describe the bug
I have one .Net Core 3.1 lambda function and several Node functions in my Amplify project. The Node functions are only deployed on amplify push if a change is made to them, while the .Net core function is always deployed.
This is visualized well in the status list of resources that are going to be deployed before confirming yes when running amplify push.
Amplify CLI Version 4.31.0
To Reproduce
Steps to reproduce the behavior or terminal output if applicable
Run amplify function add and select runtime .NET Core 3.1. After the function is created run amplify push multiple times.
Expected behavior
I expect the .Net Core Lambda function to be deployed on the first amplify push and then not on the following pushes until a change is made to it. Just like for Node functions.
Desktop (please complete the following information):
- OS: [e.g. Mac/Windows/Ubuntu] Windows 10
- Node Version. You can use
node -vto check the node version on your system v12.14.0
Hi @atlesp, I wasn't able to reproduce on Mac. It could be a Windows issue so I'll try that next.
This is visualized well in the status list of resources that are going to be deployed before confirming yes when running amplify push.
Can you share an example of the amplify status output after you made a change to a node function?
Hi @jhockett
The first function in the list are a node function that has changes, the second is a .Net function with no changes, and the rest are node functions with no changes

@atlesp I tried to reproduce this on a mac and windows machine as well with no luck, after pushing the functions I don't see any updates, they show no change. We are hashing the folder contents to detect changes, is that possible that some files are modified by some external software (antivirus?) that kicks in the change detection?
If you could provide exact repro steps that would help.
I tested to add two new dotnet functions with different settings to the same amplify application now

And none of these two has the same issue. So either is something fixed in the cli when adding a dotnet function or something weird is going on in my existing function. I will make some more tests and report back if I find something
I added a new dotnetcore function now and ported the code. And that works as expected, no changes equal no deployment.
My only guess is that it is related to that the old function was added with an early version of the CLI with dotnet support, but that is just guessing. Thanks for investigating it for me @attilah .
My new dotnet function got the same issue after a few deploys without any changes in that function.
I have to admit that I have no clue why this is happening. Nobody else experiencing this?
My only idea is one deployment failed elsewhere in the stack, and when the deployments fails of some due to issues some other places, I sometimes see this error:
Updating resources in the cloud. This may take a few minutes...2020-12-21T08:13:53.011Z - error: uncaughtException: EBUSY: resource busy or locked, open 'C:\Users\atle\Documents\GitHub\Catalog\amplify\#current-cloud-backend\function\CatalogShopWindows1252EncodeFile\src\obj\Debug\netcoreapp3.1\CatalogShopWindows1252EncodeFile.assets.cache' date=Mon Dec 21 2020 09:13:52 GMT+0100 (GMT+01:00), pid=20288, uid=null, gid=null, cwd=C:\Users\atle\Documents\GitHub\Catalog, execPath=C:\Program Files\nodejs\node.exe, version=v12.14.0, argv=[C:\Program Files\nodejs\node.exe, C:\Users\atle\AppData\Roaming\npm\node_modules\@aws-amplify\cli\bin\amplify, push], rss=357924864, heapTotal=321101824, heapUsed=274958408, external=10846256, loadavg=[0, 0, 0], uptime=769094, trace=[], stack=[Error: EBUSY: resource busy or locked, open 'C:\Users\atle\Documents\GitHub\Catalog\amplify\#current-cloud-backend\function\CatalogShopWindows1252EncodeFile\src\obj\Debug\netcoreapp3.1\CatalogShopWindows1252EncodeFile.assets.cache']
@attilah could you please point me to the code that is decided if it has been changed or not? So can see if I can find what is changing and maybe why.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.