Disable Property of Azure Functions not working in Visual Studio 2017

Avinash patil picture Avinash patil · Aug 18, 2017 · Viewed 7.8k times · Source

I have Azure function with timer trigger.

public static void Run([TimerTrigger("0 */15 * * * *"), Disable("True")]TimerInfo myTimer, TraceWriter log)

Here the Disable("true") is not working. it generates the function.json as "disabled": "True", which is not correct. It should be "disabled": True, Disable only accepts string value. Is there any way to change this? or any other way to disable function?

Answer

Avinash patil picture Avinash patil · Aug 18, 2017

Disable properties default values is true.

Use Disable() instead of Disable("true").

So the code will look like

public static void Run([TimerTrigger("0 */15 * * * *"), Disable()]TimerInfo myTimer, TraceWriter log) .

If you want to enable the function use Disable("False").