InternalServerError when creating Microsoft.Web/sites/functions and Microsoft.Web/sites/functions/keys
Scenario
I would like to define Microsoft.Web/sites/functions and Microsoft.Web/sites/functions/keys resources in my ARM template. My purpose is to create function with predefined function key before or after I upload there some code.
Environment and repro
My function App has linux consumption app service plan. I use yaml pipeline at Azure Devops My FunctionApp is already created and there is already "MyFunction" function deployed there.
ARM
{
"name": "MyFunction",
"type": "Microsoft.Web/sites/functions",
"location": "[variables('location')]",
"apiVersion": "2018-11-01",
"dependsOn": [
"[variables('FunctionAppName')]"
],
"properties": {
},
"resources": [
{
"type": "keys",
"apiVersion": "2020-06-01",
"dependsOn": [
"MyFunction"
],
"name": "CustomFunctionKey",
"properties": {
"name": "CustomFunctionKey",
"value": "[parameters('SomeSecretValue')]"
}
}
]
}
Unfortunately my pipeline deployment with AzureDevops ends up with error:
##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
##[error]Details:
##[error]undefined: Encountered an error (InternalServerError) from host runtime.
@pawel-zolty apologies for the delay here.
Can you please share more information about your scenario? Are you trying to deploy the function payload as part of your ARM deployment? If so, the recommendation for this is to reference a blob/package URL and use "run from package".
For the key management, this should be supported in ARM. Are you still experiencing issues with that?
@mattchenderson would you be able to share a link to the ARM samples you had for key management scenarios? Thanks!