Function App host keys not created on ARM deployment

Razeen Hendricks 56 Reputation points

I created an ARM template a while ago that was working fine, but all of a sudden now I have no host keys listed even though the arm deployment logging shows as successful.


I've tried to create a "default" / "_master" host key in Azure Portal, and despite saying it's successful, it auto-refreshes and still lists nothing.
In the activity log, a 404 error is listed for "List Web Apps Functions Host Keys" with the message "Encountered an error (InternalServerError) from host runtime."

If I create it via Azure Portal, then those keys did show in one attempt, but then were not created in a later attempt (see above image). The configuration app settings of the portal and arm deployments are identical to the function app (that did have the host keys), including the "AzureWebJobsStorage" app setting value.
It's using a general usage V2 storage account, and a S1 app service plan.

Here's the json I'm using:

      "type": "Microsoft.Web/Sites",  
      "apiVersion": "2020-06-01",  
      "name": "[parameters('function_app_csharp_name')]",  
      "location": "[variables('location')]",  
      "kind": "functionapp",  
      "identity": {  
        "type": "SystemAssigned"  
      "properties": {  
        "enabled": true,  
        "httpsOnly": true,  
        "serverFarmId": "[concat(subscription().id, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', parameters('app_service_plan_name'))]",  
        "siteConfig": {  
          "alwaysOn": true,  
          "http20Enabled": true,  
          "minTlsVersion": "1.2",  
          "ftpsState": "Disabled",  
          "appSettings": [  
              "name": "AzureWebJobsStorage",  
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storage_account_name'), ';EndpointSuffix=', environment(), ';AccountKey=',listKeys(concat(subscription().id, '/resourceGroups/', parameters('storage_accounts_resource_group'), '/providers/Microsoft.Storage/storageAccounts/', parameters('storage_account_name')), '2019-06-01').keys[0].value)]"  
              "name": "FUNCTIONS_EXTENSION_VERSION",  
              "value": "~3"  
              "value": "[reference(resourceId('Microsoft.Insights/Components', parameters('app_insights_name')), '2020-02-02-preview').InstrumentationKey]"  
              "value": "[reference(resourceId('Microsoft.Insights/Components', parameters('app_insights_name')), '2020-02-02-preview').ConnectionString]"  
              "name": "FUNCTIONS_WORKER_RUNTIME",  
              "value": "dotnet"  
              "name": "KEY_VAULT_NAME",  
              "value": "[parameters('keyvault_name')]"  

Could you please assist in resolving this, and explain why this happens?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,017 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,511 Reputation points

    Hello @Razeen Hendricks , Did you try restarting the function? Also you may refer to for the script structure.

    Also, check if the storage account has any VNet configuration. If yes, then, you need to configure VNet for the function app too.

    Also, confirm if you have WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE , in case of consumption/ Premium