I have developed an azure timer trigger function. I am taking timer schedule from appSettings of the function app as following.
function.json
This is working fine for given static schedule. But this schedule should be able to change as per the user requirement from another web application, when user need to change the schedule.
I am struggling to change schedule parameter from external application dynamically. What i was tried is deploy an ARM templatere injecting new schedule values from following ARM template.
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "String"
},
"location": {
"type": "String"
},
"subscriptionId": {
"type": "String"
},
"schedule1": {
"type": "String"
},
"schedule2": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"kind": "functionapp",
"name": "[parameters('name')]",
"apiVersion": "2016-03-01",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [
{
"name": "schedule1",
"value": "[parameters('schedule1')]"
},
{
"name": "schedule2",
"value": "[parameters('schedule2')]"
}
]
},
"clientAffinityEnabled": false,
"reserved": false
}
}
]
}
However, this is not overriding existing appSettings. Instead, it returns an error "Web site already exists" Is there any method to override appSettings as explained above and restart the function app in order to affect new appSettings parameters.