Function app new appsettings not present in production slot

119 views Asked by At

I am new with arm template and very first maybe my question is silly but after finding on GitHub regarding my question I was not able to get any strong answer for the same so posting here.

I created one arm template which deploy function app with the configuration and swap the slot from deployment to production.

Everything was working fine but when I introduce new property (appsettings) for my function app in the arm template after the swap operation new property was not swapped. I checked it after the deployment it is present in deployment slot but it was not present in production slot after the swap operation.

For the workaround, I need to run my pipeline again to work correctly or swap manually from azure portal to run my function app correctly. Let me know anything that I missed it.

Here is the arm template for my function app.

{
      "apiVersion": "2018-11-01",
      "type": "Microsoft.Web/sites",
      "name": "Test",
      "location": "[parameters('location')]",
      "kind": "functionapp",
      "dependsOn": [
        "[resourceId('Microsoft.Storage/storageAccounts', 'test')]",
        "[resourceId('Microsoft.Web/serverfarms', 'test')]"
      ],
      "identity": {
        "type": "UserAssigned",
        "userAssignedIdentities": {
          "some identity": {}
        }
      },
      "properties": {
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'test')]",
        "httpsOnly": true,
        "keyVaultReferenceIdentity": "",
        "siteConfig": {
          "http20Enabled": true,
          "minTlsVersion": "1.2",
          "netFrameworkVersion": "v6.0",
          "appSettings": [
            {
              "name": "Key1",
              "value": "Test1"
            },
            {
              // If I'll add new property and it will not consider first deployment after the slot swap. I need to run pipeline again or need to swap manually to get this newly property in production slot.
            }
          ],
          "cors": {
            "allowedOrigins": "[if(equals(parameters('CORSAllowedOrigins'),'*'), variables('corsWildcard'), variables('corsFullList'))]"
          }
        }
      },
      "resources": [
        {
          "apiVersion": "2016-08-01",
          "dependsOn": [
            "[resourceId('Microsoft.Web/sites', Test)]"
          ],
          "kind": "functionapp",
          "location": "[resourceGroup().location]",
          "name": "[variables('deploymentSlotName')]",
          "properties": {
            "httpsOnly": true,
            "enabled": true,
            "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
            },
          "type": "Microsoft.Web/sites/slots"
        }
      ]
    }

Here is the yaml task for swap.

- task: AzureAppServiceManage@0
    displayName: Swapping Function App to Production Slot
    inputs:
      azureSubscription: $(AZConnectionName)
      WebAppName: ${{ FunctionName }}
      ResourceGroupName: ${{ RGName }}
      SourceSlot: $(SlotName)
      SwapWithProduction: $(SwapSlot)

Production slot should consider the new appsettings after the swapping behavior completed on first run.

Thanks,
Kirtan

0

There are 0 answers