title: Azure website resource template error
body: <p>I'm attempting to use the <a href="http://azure.microsoft.com/en-us/documentation/articles/powershell-azure-resource-manager/" rel="noreferrer">AzureResourceManager</a> PowerShell module to create and configure a website.  I started with a template file generated by Visual Studio, which works fine when I use it via <code>New-AzureResourceGroup -TemplateFile website.json</code>.</p>
  
  <p>So now I'm trying to tweak the template file to configure the site.  I'm trying to set the php and .NET Framework versions.  According to the <a href="http://schema.management.azure.com/schemas/2014-04-01/Microsoft.Web.json" rel="noreferrer">schema</a> these properties are set via a config object in a resources array.</p>
  
  <p>Here's the website section of my json template.  The "resources" section is what I added:</p>
  
  <pre><code>    {
          "apiVersion": "2014-06-01",
          "name": "[parameters('siteName')]",
          "type": "Microsoft.Web/sites",
          "location": "[parameters('siteLocation')]",
          "tags": {
              "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource"
          },
          "dependsOn": [
              "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
          ],
          "properties": {
              "name": "[parameters('siteName')]",
              "serverFarm": "[parameters('hostingPlanName')]"
          },
          "resources": [
              {
                  "apiVersion": "2014-04-01",
                  "type": "Microsoft.Web/sites/config",
                  "name": "config",
                  "properties": {
                      "name": "config",
                      "phpVersion": "",
                      "netFrameworkVersion": "V4.5"
                  }
              }
          ]
      },
  </code></pre>
  
  <p>When I pass this template to <code>Test-AzureResourceGroupTemplate</code> I get this error:</p>
  
  <pre><code>Code    : InvalidTemplate
  Message : Deployment template validation failed: 'The template resource 'config' for type 'Microsoft.Web/sites/config' has 
            incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root 
            resource type must have segment length one greater than its resource name'.
  </code></pre>
  
  <p>I can't find any documentation on this.  Does anyone know what this error means, or what I'm doing wrong?</p>