Search code examples
azuregoogle-cloud-platformazure-functionsazure-sentinel

How to change/upgrade the microsoft azure function app plan from consumption to premium under microsoft sentinel using GCP Data Connnector?


I am trying to create azure function app under azure sentinel using GCP(Google Cloud Platform) Data Connector, under ARM template >> edit script I tried with sku mentionining and its paramaters I passed, but the requirement does not satisfied. Inside sentinel create azure function with premium or standard plan, by defualt it is creating Y1 sku(which is consumption based plan).

ARM template script for modifications:

"functionAppPlanSku": {
  "type": "string",
  "defaultValue": "EP1",
  "allowedValues": [
    "EP1",
    "EP2",
    "EP3"
  ],
  "metadata": {
    "description": "Specifies the Azure Function hosting plan SKU."
  }

After changing the script under ARM template and deployment done, deployment getting successful but when I check the plan of the function app it is not changed as expected. It is Y1 - consumption only.


Solution

  • Try using the below ARM Template code to Deploy the Function with EP1 Premium tier:-

    ARM Template:-

    Reference MS Document.

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "metadata": {
          "_generator": {
            "name": "bicep",
            "version": "0.14.46.61228",
            "templateHash": "1987928307124973420"
          }
        },
        "parameters": {
          "siteName": {
            "type": "string",
            "defaultValue": "[format('FuncApp-{0}', uniqueString(resourceGroup().id))]",
            "metadata": {
              "description": "The name of you Web Site."
            }
          },
          "storageAccountName": {
            "type": "string",
            "defaultValue": "[format('store{0}', uniqueString(resourceGroup().id))]"
          },
          "location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
              "description": "Location for all resources."
            }
          },
          "functionAppPlanSku": {
            "type": "string",
            "defaultValue": "EP1",
            "allowedValues": [
              "EP1",
              "EP2",
              "EP3"
            ],
            "metadata": {
              "description": "The SKU tier for the Function App Plan."
            }
          }
        },
        "variables": {
          "hostingPlanName": "[format('hpn-{0}', resourceGroup().name)]"
        },
        "resources": [
          {
            "type": "Microsoft.Web/sites",
            "apiVersion": "2022-03-01",
            "name": "[parameters('siteName')]",
            "kind": "functionapp,linux",
            "location": "[parameters('location')]",
            "properties": {
              "siteConfig": {
                "appSettings": [
                  {
                    "name": "FUNCTIONS_WORKER_RUNTIME",
                    "value": "python"
                  },
                  {
                    "name": "FUNCTIONS_EXTENSION_VERSION",
                    "value": "~4"
                  },
                  {
                    "name": "AzureWebJobsStorage",
                    "value": "[format('DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}', parameters('storageAccountName'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2022-09-01').keys[0].value)]"
                  }
                ]
              },
              "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
              "clientAffinityEnabled": false
            },
            "dependsOn": [
              "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
              "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
            ]
          },
          {
            "type": "Microsoft.Web/serverfarms",
            "apiVersion": "2022-03-01",
            "name": "[variables('hostingPlanName')]",
            "location": "[parameters('location')]",
            "kind": "linux",
            "properties": {
              "reserved": true
            },
            "sku": {
              "tier": "Premium",
              "name": "[parameters('functionAppPlanSku')]"
            }
          },
          {
            "type": "Microsoft.Storage/storageAccounts",
            "apiVersion": "2022-09-01",
            "name": "[parameters('storageAccountName')]",
            "location": "[parameters('location')]",
            "kind": "Storage",
            "sku": {
              "name": "Standard_LRS"
            }
          }
        ]
      }
    

    Output:-

    enter image description here

    enter image description here