Hi Team,
I have been trying to disable/enable Python Azure Function hosted on Consumption Function App but I have had no success. However I was able to disable/enable a C# Azure Function on Consumption plan. I have tried both methods suggested by this answer from the following Microsoft thread :
First I tried to set the attribute "isDisabled" to "true" when I create the function using the Create Azure Function Rest API from the following documentation :
(https://docs.microsoft.com/en-us/rest/api/appservice/web-apps/create-function)
Second I have tried to use the below endpoint to enable and disable a particular function.
Request Body:
{"properties":"disabled"}
OR
{"properties":"enabled"}
Both approaches do not work for Python function hosted on Consumption plan. But for C# only the second solution works. When I send the REST PUT request for the Python function hosted on Consumption plan I get a "bad request 400" response with the following error
{
"Code":"BadRequest",
"Message":"AppSetting with name 'AzureWebJobs.<my function name>.Disabled' is not allowed.",
"Target":null,
"Details":[
{
"Message":"AppSetting with name 'AzureWebJobs.<my function name>.Disabled' is not allowed."
},
{
"Code":"BadRequest"
},
{
"ErrorEntity":{
"ExtendedCode":"04072",
"MessageTemplate":"AppSetting with name '{0}' is not allowed.",
"Parameters":[
"AzureWebJobs.<my function name>.Disabled"
],
"Code":"BadRequest",
"Message":"AppSetting with name 'AzureWebJobs.<my function name>.Disabled' is not allowed."
}
}
],
"Innererror":null
}
Can you please let me know if you notice the same issue on your end? Also if there is anyway I can programmatically disable a Python Azure Function hosted on Consumption Function App using REST API? perhaps I need to get the higher tier for Python functions?
Thanks for your time