Schaemelhout
Schaemelhout

Reputation: 705

Azure Function in Node.js and shared files

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?

Upvotes: 3

Views: 2723

Answers (1)

mathewc
mathewc

Reputation: 13568

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.

Upvotes: 7

Related Questions