Reputation: 4913
I have developed an Azure function in a .Csx file that calls a C# library.
Creation of the Function App in Azure is fine.
First deployment to Azure is Ok.
Any update to the function that makes a change to the called Dll works fine on the local emulator.
But as soon I deploy a new version (using Web deploy, or a custom deploy script using Zip + REST API) of the Function App to Azure, I get a message like :
2017-02-10T16:54:29.160 Exception while executing function: Functions.MailSenderFunction. mscorlib:
Exception has been thrown by the target of an invocation. f-MailSenderFunction__-1032464143:
Method not found: 'Void MyCompany.MailSenderFunctionLib.MailSenderFunctionProcessor.Run(MyCompany.MyProject.Common.Models.Mail, MyCompany.MailSenderFunctionLib.LogHandler)'.
Even if I delete the function before deployment using Portal, Http Rest API, it does not help.
I need to recreate a brand new function App resource in order to have my new version to work
With no change to code, If a create a brand new empty Function App and deploy the Function App to Azure, then I get a nice working Azure function in Azure.
But I can't redeploy to same Azure Function App.
I ve been searching for a week. I am afraid it is an Azure bug.
Has anybody an idea ?
Upvotes: 2
Views: 2343
Reputation: 12398
I have been using azure functions with dlls for a while now and got around the issue with using Team Foundation Service Release builds.
I structured my release builds into 3 steps
Step 01. stop the azure function app using power shell azure powershell.
Step 02. commit your changes to azure function internal git repo
Step 03. start the azure function app using powershell azure powershell.
you can get the powershell cmd for doing this from the portal itself.
Portal -> your app -> resource explorer -> click the "Go" link in the blade which opens a new tab -> there should be a powershell tab which has all the related powershell commands.
Hope this helps
Upvotes: 2