Reputation: 5259
I'm trying to disable a Function app, by using the Disable
attribute with an app setting:
[Disable("Disable")]
[FunctionName("MyFunction")]
public static void Run([TimerTrigger("0 0 8 * * *")]TimerInfo myTimer)
When compiling this function, the function.json
looks like this:
{
...
"disabled": "Disable",
...
}
On my function app on Azure, I've defined the following app setting:
But when looking at the functions in the function app, the function is still disabled:
I was expecting the function not to be disabled, since the value of the app setting is 0
. I guess the function app is disabled if the value of the disabled
field in json is true if not set to false
?
Upvotes: 2
Views: 1077
Reputation: 35154
This looks like portal UI issue to me. I created a Timer Function and followed your scenario. The function is shown as disabled in the portal, but it still runs on schedule.
If I change the setting from 0
to 1
, it's still shown as disabled, but also doesn't run anymore.
Update (thanks to @ahmelsayed): See github issue (and related). UI only handles truthy values for that property, which should be fixed.
Upvotes: 3