In Azure Functions (runtime version 2.x), I can use Azure CLI to toggle the state of a function (enable/disable) by using the command az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.functionName.Disabled=$disabled
but this only toggles the production slot. What is the correct syntax to toggle functions in the other slots? What should the --name
parameter be? I tried functionApp/stage
and functionApp-stage
but get errors as if they don't exist.
You should use -s or --slot and specify the slot name.
https://docs.microsoft.com/en-us/cli/azure/functionapp?view=azure-cli-latest#optional-parameters