Skip to content

Azure Function App - private assembly gets cached - updating file has no effect #953

@marklauter

Description

@marklauter

Uploading private assembly to Azure Function /bin works, but subsequent updates don't take effect until the I kill the service process in Kudo. Restarting the app service in the Azure portal has no effect - service process must be killed. The symptom is that related changes in the Azure function will build after the assembly has been updated, such as accessing a new property in the assembly from the function, however the function will fail during runtime.

Repro steps

  1. create new function app
  2. create new event hubs trigger function
  3. create an assembly with a public class with at least one property
    3.a upload the assembly to function_name/bin and setup the reference in the function
    3.b the string passed to the function will be json from event hubs
    3.c use newtonsoft to deserialize the object
    3.d output the value of the property to the log
  4. create a console app that references the assembly from step 3
    4.a console app - instantiate the class and set the property with a value that will be logged by the event hub function
    4.b console app - write the object to event hubs
  5. the function will trigger, newtonsoft will decode the object, and the log will output the property value
  6. change the name of the property, update the assembly version, rebuild the assembly, upload the new version to the function_name/bin folder
  7. update the function with the new property name
  8. the function will compile
  9. run the console app
  10. the function will trigger and will error with something like this:
    2016-11-18T22:27:09.720 Exception while executing function: Functions.EventHubTriggerCSharp1. mscorlib: Exception has been thrown by the target of an invocation. EventHubTriggerCSharp1: Method not found: 'System.String AzureFunctionTest.DatagramMetadata.get_NewProperty()'.
    10.a try restarting the app service
    10.b no effect
  11. open kudo, kill all the processes
  12. wait a while for everything to restart
  13. run the console app
  14. the function triggers and runs as expected - logs output of renamed property

same behavior for .config files, except that changes to .config files never take effect, even after killing the service processes.

Expected behavior

I would expect any update to any file in the bin folder to be reflected in the behavior of the function.

Actual behavior

See repro steps

Known workarounds

Kill app service processes from Kudo.

Related information

Much more info and some sample code here:
http://stackoverflow.com/questions/40687108/azure-function-app-private-assembly-gets-cached-updating-file-has-no-effect

  • Programming language used
    C#
  • Links to source
    See StackOverflow link about

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions