Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Property of Azure Functions not working in Visual Studio 2017

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?

like image 215
Avinash patil Avatar asked Aug 18 '17 06:08

Avinash patil


1 Answers

Functions 2.x can be disabled individually via local.settings.json in the following manner

{
    "IsEncrypted": false,
    "Values": {
    "AzureWebJobs.MyFunctionNameOne.Disabled": "true",
    "AzureWebJobs.MyFunctionNameTwo.Disabled": "true",
    ...
    }
}

Ref: https://docs.microsoft.com/en-us/azure/azure-functions/disable-function#functions-2x---all-languages

like image 177
golfalot Avatar answered Oct 13 '22 23:10

golfalot