Warm tip: This article is reproduced from stackoverflow.com, please click
azure azure-cli azure-functions

Disable Azure function via AzureCLI does not disable function

发布于 2020-04-18 09:52:40

I have a function app in Azure that has several functions defined. According to this document, I can use AzureCLI to disable a function in a function app. When I run az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.myFunction.Disabled=true it creates the name value pair in application settings as stated in the documentation, but the state of the function does not toggle according to the value I set. Is something else required to toggle the state of the function when I run the AzureCLI commmand?

Questioner
Anthony Klotz
Viewed
33
Hury Shen 2020-02-20 14:59

According to the comments, the problem was solved. OP change the azure function runtime from 1.x to 2.x and then it can be disabled by running this command.

az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.myFunction.Disabled=true

Update1: enter image description here

Update2:

For this problem, I confirmed with azure support team. They provided me with the response below:

They found the feature of az function app config part was released at Sep. 2018, and at that time runtime v1 was already quite out of date. So it is possible that the product team only develops for the runtime v2. enter image description here

In a word, we can just do this operation on v2 and v3, or use Azure Portal UI.