2016-04-25 15 views
0

複数のWebアプリケーションを展開するためのARMテンプレートを開発しようとしていますが、Microsoft.Web/sites/configの設定を使用してwebappを設定しようとしています。私がそこに置いたものは、webappをデプロイするときの設定は無視されます。私はDavid Ebbos exampleにテンプレートを載せています。AzureはARMテンプレートのサイト設定を無視します

これは私が現時点でしようとしていますものです:私はについて少し混乱しています

// Serverfarm (appservice) 
{ 
    "apiVersion": "2015-08-01", 
    "type": "Microsoft.Web/serverfarms", 
    "sku": { 
     "name": "B1", 
     "tier": "Standard", 
     "size": "B1", 
     "family": "B", 
     "capacity": 1 
    }, 
    "name": "[variables('appSvcName')]", 
    "location": "[resourceGroup().location]", 
    "tags": { 
     "project": "[[variables('webAppName')]]" 
    }, 
    "properties": { 
     "name": "[variables('appSvcName')]", 
     "numberOfWorkers": 1 
    } 
}, 
// Site (Webapp) 
{ 
    "apiVersion": "2015-08-01", 
    "type": "Microsoft.Web/sites", 
    "name": "[variables('webAppName')]", 
    "location": "[resourceGroup().location]", 
    "tags": { 
     "project": "[[variables('webAppName')]]" 
    }, 
    "dependsOn": [ 
     "[resourceId('Microsoft.Web/serverfarms', variables('appSvcName'))]" 
    ], 
    "properties": { 
     "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appSvcName'))]", 
     "hostNames": [ 
      "[concat(variables('webAppName'), '.azurewebsites.net')]" 
     ], 
     "enabledHostNames": [ 
      "[concat(variables('webAppName'), '.azurewebsites.net')]", 
      "[concat(variables('webAppName'), '.scm.azurewebsites.net')]" 
     ], 
     // TODO : These resources are ignored so far 
     "resources": [ 
      { 
       "apiVersion": "2015-08-01", 
       "name": "web", 
       "type": "Microsoft.Web/sites/config", 
       "location": "[resourceGroup().location]", 
       "dependsOn": [ 
        "[resourceId('Microsoft.Web/Sites', variables('webAppName'))]" 
       ], 
       "properties": { 
        "phpVersion": "", 
        "netFrameworkVersion": "v4.6", 
        "use32BitWorkerProcess": false, /* 64-bit platform */ 
        "webSocketsEnabled": true, 
        "alwaysOn": true, 
        "requestTracingEnabled": true, /* Failed request tracing, aka 'freb' */ 
        "httpLoggingEnabled": true, /* IIS logs (aka Web server logging) */ 
        "logsDirectorySizeLimit": 40, /* 40 MB limit for IIS logs */ 
        "detailedErrorLoggingEnabled": true, /* Detailed error messages */ 
        "remoteDebuggingEnabled": false, 
        "remoteDebuggingVersion": "VS2015", 
        "defaultDocuments": [ 
         "default.aspx", 
         "Default.htm", 
         "Default.html", 
         "index.html", 
         "hostingstart.html" 
        ] 
       } 
      }, 
      { 
       "apiVersion": "2015-08-01", 
       "name": "connectionstrings", 
       "type": "Microsoft.Web/sites/config", 
       "location": "[resourceGroup().location]", 
       "dependsOn": [ 
        "[resourceId('Microsoft.Web/Sites', variables('webAppName'))]" 
       ], 
       "properties": { 
        "umbracoDbDsn": { 
         "value": "[concat('Data Source=tcp:', reference(concat('Microsoft.Sql/servers/', variables('sqlServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', variables('sqlDbName'), ';User Id=', variables('appSvcName'), '@', variables('sqlServerName'), ';Password=e15cO1PtIR5dtq3zUlwK;')]", 
         "type": "SQLAzure" 
        } 
       } 
      } 
     ] 
    } 
} 

ことの一つは、私は私の紺碧PowerShellコンソールで(Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypesを実行するときに利用可能なサイトの/ config ResourceTypeNameがないことです。

何がありますか? config resourcetypeをテンプレート定義から削除しましたか?間違ったapiVersionを使用していますか?私は、さまざまな組み合わせを試してみましたが、無駄です。

+1

なぜ「リソース」を「プロパティ」内に配置しますか?それは "プロパティ"の外で、あなたのWebアプリケーションの下にあるはずです。 –

+0

私はそれを発見するために@ジャックセンに感謝しなかった。 – Hauge

答えて

1

このブログを見てください - http://wp.sjkp.dk/arm-templates-set-always-on-and-other-site-properties/

あなたがウェブ/設定のresource.properties下SITECONFIGオブジェクトが必要になります。

{ 
    "apiVersion": "2015-08-01", 
    "name": "[parameters('webSiteName')]", 
    "type": "Microsoft.Web/sites", 
    "location": "[resourceGroup().location]", 
    "tags": { 
     "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource", 
     "displayName": "Website" 
    }, 
    "dependsOn": [ 
     "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]" 
    ], 
    "properties": { 
     "name": "[parameters('webSiteName')]", 
     "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" 
    }, 
    "resources": [ 
     { 
      "apiVersion": "2015-08-01", 
      "name": "web", 
      "type": "config", 
      "dependsOn": [ 
       "[concat('Microsoft.Web/sites/', parameters('webSiteName'))]" 
      ], 
      "properties": { 
       "javaVersion": "1.8", 
       "javaContainer": "TOMCAT", 
       "javaContainerVersion": "8.0", 
       "siteConfig": { 
        "<supported-property>": "<value>", 
       } 
      } 
     } 
    ] 
} 
0

@JackZhengがコメントしたスキーマ内のエラー。これらのエラーは、Test-AzureRmResourceGroupDeploymentコマンドによって報告されていないため、見つけて修正するのがやや難しくなっています。

関連する問題