Node.js和共享文件中的Azure函数 [英] Azure Function in Node.js and shared files
问题描述
我正在通过Bitbucket CI部署Azure功能.我可以通过多个功能从共享目录中引用文件,这很棒.
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.
但是,当我尝试更新共享代码并通过推送到我的master分支来部署它时,我可以在Kudu控制台中看到正在更新的文件,但是我的函数本身似乎仍然引用了旧版本的文件...如果我关闭CI,我没有这个问题.
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?
推荐答案
您可以通过将自定义共享目录添加到host.json
文件中的watchDirectories
数组中,来指定自定义共享目录的更改:
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" ]
}
然后,运行时将监视那些目录中的文件是否有更改,并根据需要重新启动/重新加载.请注意,默认情况下已配置对顶级node_modules
目录的监视.
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.
这篇关于Node.js和共享文件中的Azure函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!