question

KARTHIKEYANK-7138 avatar image
0 Votes"
KARTHIKEYANK-7138 asked MayankBargali-MSFT commented

Is there any way to exclude directories from being watched for host restart?

Currently the directory that contains the function script file is automatically watched. In my case, node_modules is also present in the same directory. Hence any change made to this directory results in restarting of host. Is there any way to exclude directories from being watched. Similar to what we have in host.json "watchDirectories", Do we have any attribute that satisfies my request?

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Hi @KARTHIKEYANK-7138

Welcome to Microsoft Q&A! Thanks for posting the question.

I don't see any configuration that can be used for your scenario as per the available setting for azure function runtime.
I will reach out to my team to get confirmation on the same and if there is any workaround.

Update:
Please feel free to raise a feature request on UserVoice to support this, if this is something that you would want to see in Functions.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MayankBargali-MSFT
·
Is there any way to disable this host restart feature regarding "watchDirectories"? Because my functionapp restarts multiple times for unnecessary changes made in node_modules and sometimes get stuck.

0 Votes 0 ·

@KARTHIKEYANK-7138 I am still waiting for product team confirmation if there is any workaround. The only way I could think is to move the files to other directories which are not watched by default.

0 Votes 0 ·

Thanks @MayankBargali-MSFT. Please let me know once you get the confirmation. Moreover, it would be good if there is a way to stop watching directories by default.

0 Votes 0 ·
Show more comments