title: Azure Function ARM template deletes the existing application settings those are not part of the template file
body: <p>I have created function app with default application settings using ARM template. Unfortunately, when the ARM template deployed it deleted any application settings that were not defined in the ARM template.</p>
  <p>This is ARM template using for function app:</p>
  <pre><code>    {
    &quot;$schema&quot;: &quot;https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#&quot;,
    &quot;contentVersion&quot;: &quot;1.0.0.0&quot;,
    &quot;parameters&quot;: {
      &quot;functionAppName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;defaultValue&quot;: &quot;[concat('fnapp', uniqueString(resourceGroup().id))]&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The name of the function app that you wish to create.&quot;
        }
      },
      &quot;newOrExisting&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;allowedValues&quot;: [
          &quot;new&quot;,
          &quot;existing&quot;
        ],
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;Choose the app service plan based on these values&quot;
        }
      },
      &quot;existingHostingPlanName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The name of the existing hosting plan&quot;
        }
      },
      &quot;existingResourceGroupName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The name of the existing resource group&quot;
        }
      },
      &quot;newHostingPlanName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The name of the new hosting plan&quot;
        }
      },
      &quot;sku&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;allowedValues&quot;: [
          &quot;D1&quot;,
          &quot;F1&quot;,
          &quot;B1&quot;,
          &quot;B2&quot;,
          &quot;B3&quot;,
          &quot;S1&quot;,
          &quot;S2&quot;,
          &quot;S3&quot;,
          &quot;P1&quot;,
          &quot;P2&quot;,
          &quot;P3&quot;,
          &quot;P1V2&quot;,
          &quot;P2V2&quot;,
          &quot;P3V2&quot;,
          &quot;I1&quot;,
          &quot;I2&quot;,
          &quot;I3&quot;,
          &quot;Y1&quot;
        ],
        &quot;defaultValue&quot;: &quot;S1&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The pricing tier for the hosting plan.&quot;
        }
      },
      &quot;workerSize&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;allowedValues&quot;: [
          &quot;0&quot;,
          &quot;1&quot;,
          &quot;2&quot;
        ],
        &quot;defaultValue&quot;: &quot;0&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The instance size of the hosting plan (small, medium, or large).&quot;
        }
      },
      &quot;applicationInsightsName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The Application Insights Name.&quot;
        }
      },
      &quot;storageAccountName&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;Name of the Storage Account.&quot;
        }
      },
      &quot;location&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;defaultValue&quot;: &quot;[resourceGroup().location]&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;Location for all resources.&quot;
        }
      },
      &quot;runtime&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;defaultValue&quot;: &quot;dotnet&quot;,
        &quot;allowedValues&quot;: [
          &quot;node&quot;,
          &quot;dotnet&quot;,
          &quot;java&quot;
        ],
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The language worker runtime to load in the function app.&quot;
        }
      },
      &quot;identityType&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The Identity type&quot;
        }
      },
      &quot;functionRuntimeVersion&quot;: {
        &quot;type&quot;: &quot;string&quot;,
        &quot;defaultValue&quot;: &quot;~3&quot;,
        &quot;metadata&quot;: {
          &quot;description&quot;: &quot;The runtime version for the function app&quot;
        }
      }
    },
    &quot;variables&quot;: {
      &quot;serverFarmId&quot;: &quot;[ if(equals(parameters('newOrExisting'),'new'),resourceId('Microsoft.Web/serverfarms',parameters('newHostingPlanName')), concat(subscription().id,'/resourceGroups/',parameters('existingResourceGroupName'),'/providers/Microsoft.Web/serverfarms/',parameters('existingHostingPlanName')))]&quot;,
      &quot;functionWorkerRuntime&quot;: &quot;[parameters('runtime')]&quot;
    },
    &quot;resources&quot;: [
      {
        &quot;condition&quot;: &quot;[equals(parameters('newOrExisting'),'new')]&quot;,
        &quot;type&quot;: &quot;Microsoft.Web/serverfarms&quot;,
        &quot;apiVersion&quot;: &quot;2020-06-01&quot;,
        &quot;name&quot;: &quot;[parameters('newHostingPlanName')]&quot;,
        &quot;location&quot;: &quot;[parameters('location')]&quot;,
        &quot;sku&quot;: {
          &quot;Name&quot;: &quot;[parameters('sku')]&quot;
        },
        &quot;properties&quot;: {
          &quot;name&quot;: &quot;[parameters('newHostingPlanName')]&quot;,
          &quot;workerSize&quot;: &quot;[parameters('workerSize')]&quot;,
          &quot;numberOfWorkers&quot;: 1
        }
      },
      {
        &quot;type&quot;: &quot;Microsoft.Web/sites&quot;,
        &quot;apiVersion&quot;: &quot;2020-06-01&quot;,
        &quot;name&quot;: &quot;[parameters('functionAppName')]&quot;,
        &quot;location&quot;: &quot;[parameters('location')]&quot;,
        &quot;kind&quot;: &quot;functionapp&quot;,
        &quot;dependsOn&quot;: [
          &quot;[resourceId('microsoft.insights/components', parameters('applicationInsightsName'))]&quot;
        ],
        &quot;identity&quot;: {
          &quot;type&quot;: &quot;[parameters('identityType')]&quot;
        },
        &quot;properties&quot;: {
          &quot;serverFarmId&quot;: &quot;[variables('serverFarmId')]&quot;,
          &quot;httpsOnly&quot;: true,
          &quot;siteConfig&quot;: {
            &quot;alwaysOn&quot;: true,
            &quot;ftpsState&quot;: &quot;FtpsOnly&quot;,
            &quot;appSettings&quot;: [
              {
                &quot;name&quot;: &quot;AzureWebJobsStorage&quot;,
                &quot;value&quot;: &quot;[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value)]&quot;
              },
              {
                &quot;name&quot;: &quot;WEBSITE_CONTENTAZUREFILECONNECTIONSTRING&quot;,
                &quot;value&quot;: &quot;[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value)]&quot;
              },
                          {
                &quot;name&quot;: &quot;WEBSITE_CONTENTSHARE&quot;,
                &quot;value&quot;: &quot;[toLower(parameters('functionAppName'))]&quot;
              },
              {
                &quot;name&quot;: &quot;WEBSITE_RUN_FROM_PACKAGE&quot;,
                &quot;value&quot;: &quot;1&quot;
              },
              {
                &quot;name&quot;: &quot;FUNCTIONS_EXTENSION_VERSION&quot;,
                &quot;value&quot;: &quot;[parameters('functionRuntimeVersion')]&quot;
              },
              {
                &quot;name&quot;: &quot;WEBSITE_NODE_DEFAULT_VERSION&quot;,
                &quot;value&quot;: &quot;~10&quot;
              },
              {
                &quot;name&quot;: &quot;APPINSIGHTS_INSTRUMENTATIONKEY&quot;,
                &quot;value&quot;: &quot;[reference(resourceId('microsoft.insights/components', parameters('applicationInsightsName')), '2020-02-02-preview').InstrumentationKey]&quot;
              },
              {
                &quot;name&quot;: &quot;FUNCTIONS_WORKER_RUNTIME&quot;,
                &quot;value&quot;: &quot;[variables('functionWorkerRuntime')]&quot;
              }
            ]
          }
        }
      },
      {
        &quot;type&quot;: &quot;microsoft.insights/components&quot;,
        &quot;apiVersion&quot;: &quot;2020-02-02-preview&quot;,
        &quot;name&quot;: &quot;[parameters('applicationInsightsName')]&quot;,
        &quot;location&quot;: &quot;[parameters('location')]&quot;,
        &quot;tags&quot;: {
          &quot;[concat('hidden-link:', resourceId('Microsoft.Web/sites', parameters('applicationInsightsName')))]&quot;: &quot;Resource&quot;
        },
        &quot;properties&quot;: {
          &quot;ApplicationId&quot;: &quot;[parameters('applicationInsightsName')]&quot;,
          &quot;Request_Source&quot;: &quot;IbizaWebAppExtensionCreate&quot;
        }
      }
    ],
    &quot;outputs&quot;: {}
  }
  </code></pre>
  <p>I have referred <a href="https://github.com/Azure/azure-cli/issues/11718" rel="nofollow noreferrer">this</a> git hub issue but still it is open.</p>
  <p>So, can anyone suggest me how to resolve this issue?</p>