Search code examples
c#azurewebjob

Disable test webjob


I'm testing webjob on the local machine, I create multiple sample type trigger wejob. Like in a project there are multiple queue trigger webjob, however, all of them point to the same queue, so I want to disable others to do a test.

enter image description here

Like the image above, there are two webjob functions, when I test I want only one working.


Solution

  • There are two ways to implement it, firstly set the Disable attribute to your functions and add a Disable to your appsettings.json file.

    enter image description here

    enter image description here

    The second way is use "AzureWebJobs.YourFunctionName.Disabled": "true" setting to disable your function, set this setting in the appsettings.json.

    enter image description here

    Below is my test result, both functions are disabled.

    enter image description here