2016-09-16 43 views

回答

0

找到答案;

所有ARM模板都覆蓋您的本地設置。所以如果在我的webconfig中,我有一個連接字符串定義如下;

connectionStrings> 
    <add name="myConnectionString" connectionString="Server=localhost;Database=TimeTracker;uid=sa;pass=GodM0de1$;"/> 
    </connectionStrings> 

然後在我的website.json中,我會有以下;

"properties": { 
    "name": "[variables('webSiteName')]", 
    "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]", 
    "siteConfig": { 
     "connectionStrings": [ 
     { 
      "name": "myConnectionString", 
      "connectionString": "[parameters('WebApp_ConnString')]", 
      "type": 1 /* SQL SERVER */ 
     } 
     ] 
    } 
    } 

然後內部我的WebSite.enviornment.parameters.json文件我會有以下;

"WebApp_ConnString": { 
    "value": "Server=server01.corp.local;Database=TimeTracker;uid=sa;[email protected];" 
}