1

I'm trying to specify an app setting in my ARM template that points to a specific folder location where the web application I'm deploying should store log files, ex: D:\folder\logs. When I specify the folder location though it complains about the value being empty. If I add a double slash (\) the errors go away but it fails to deploy.

I've tried adding these specific app settings, ones with folder locations, as parameters and reference them like so in the template.json file - [parameters('log-folder')] but it fails and says it can't locate the specified parameter. I would appreciate any help. I've posted some of the parameters and template json files I'm working with below:

**template.json file**
--------
"properties": {
                "name": "[parameters('name')]",
                "siteConfig": {
                    "appSettings": [
                    {
                        "name": "CACHE",
                        "value": "[parameters('cache')]"
                    },

**parameters.json file**
--------
"parameters": {
"cache": {
            "value":"D:\\home\\filevault\\cache"
        },
}
jrd1989
  • 628
  • 10
  • 35
  • More specifically, this is the error message I am receiving "ErrorEntity": { "ExtendedCode": "01014", "MessageTemplate": "Parameter name cannot be empty.", "Parameters": [], "Code": "BadRequest", "Message": "Parameter name cannot be empty." } – jrd1989 Jan 22 '20 at 01:15

1 Answers1

0

It looks like ok your code, just make sure that your parameter are like that, don't forget type as string.

=====params.json=====

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "cache": {
      "value": "D:\\home\\filevault\\cache"
    }
  }
}

According to this error, it seems to be an error regarding [parameters('name')].

I tested it using a simple WebApp

=====deploy.json=====

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "cache": {
            "type": "string"
        }
    },
    "functions": [
    ],
    "variables": {
    },
    "resources": [

        {
            "name": "appServicePlan144524343242342",
            "type": "Microsoft.Web/serverfarms",
            "apiVersion": "2018-02-01",
            "location": "[resourceGroup().location]",
            "sku": {
                "name": "F1",
                "capacity": 1
            },
            "tags": {
                "displayName": "appServicePlan144524343242342"
            },
            "properties": {
                "name": "appServicePlan144524343242342"
            }
        },
        {
            "name": "appServicePlan144524343242342",
            "type": "Microsoft.Web/sites",
            "apiVersion": "2018-11-01",
            "location": "[resourceGroup().location]",
            "tags": {
                "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan144524343242342')]": "Resource",
                "displayName": "appServicePlan144524343242342"
            },
            "dependsOn": [
                "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan144524343242342')]"
            ],
            "properties": {
                "name": "appServicePlan144524343242342",
                "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan144524343242342')]",
                "siteConfig": {
                    "appSettings": [
                        {
                            "name": "CACHE",
                            "value": "[parameters('cache')]"
                        }
                    ]
                }
            }
        }
    ],
    "outputs": {
    }
}

CACHE was configured ok

Taguada
  • 346
  • 2
  • 6