Azure | How to disable functions in Azure Functions


How to disable functions in Azure Functions


Disabling A Single Function in Azure Functions Deployed From Visual Studio

Issue:
·       You have one Precompiled (developed through Visual Studio) Azure function app.
·       You disabled it through Portal Manually
·       Even after disabling that function it is triggering.

Solution:

It is very easy to disable function if you create it through portal. You can simply set

 "disabled": true

in function.json file.

You face challenge when it is Precompiled function (which you developed through Visual Studio and appears as read only in portal).

You have to use “Disableattribute in the code.



The Disabled attribute is the only way to disable a class library function. The generated function.json file for a class library function is not meant to be edited directly. If you edit that file, whatever you do to the disabled property will have no effect.
The same goes for the Function state switch on the Manage tab, since it works by changing the function.json file.
Also, note that the portal may indicate the function is disabled when it isn't.

You can get more details in below URL,


References,



I believe this helps. Please share your feedback.

No comments:

Post a Comment