3

I am deploying my Azure Functions through a Bitbucket CI. I am able to reference files from a shared directory in multiple functions which is great.

However, when I try to update my shared code and deploy it by pushing to my master branch, I can see the files being updated in my Kudu console, but my functions themselves still appear to have a reference to the old version of the file... I don't have this problem if I turn off my CI.

Any idea what the problem could be and how to work around this?

Schaemelhout
  • 685
  • 9
  • 25

1 Answers1

7

You can specify that your custom shared directories should be monitored for changes by adding them to a watchDirectories array in your host.json file:

{
    "watchDirectories": [ "Shared" ]
}

The runtime will then monitor files in those directories for changes, and restart/reload as necessary. Note that monitoring for a top level node_modules directory is configured by default.

mathewc
  • 13,312
  • 2
  • 45
  • 53
  • I tried this and it doesn't seem to work. I tried a simple shared module returning a number (1), I changed the number in the shared code (2) but the redeployed function is still returning the original number (1)... https://github.com/Schaemelhout/azure-function-ci – Schaemelhout Nov 20 '16 at 12:00
  • Yes, I just confirmed that there is a bug here :( I've logged an issue [here](https://github.com/Azure/azure-webjobs-sdk-script/issues/954). We'll get a fix out for this in the next few days. – mathewc Nov 20 '16 at 17:21
  • The fix is already live as noted in the release notes [here](https://github.com/Azure/azure-webjobs-sdk-script/releases/tag/v1.0.10635) – mathewc Nov 29 '16 at 16:26
  • Ok, not sure how I missed it :) thanks! awesome work. – Schaemelhout Nov 29 '16 at 18:38