【发布时间】:2016-11-03 07:41:56
【问题描述】:
如何使用 ARM 将应用程序设置部署到网站?
1 在 VS ARM Deploy json 中运行以下命令时:
....
"resources": [
{
"apiVersion": "2015-08-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "HostingPlan"
},
"sku": {
"name": "[variables('skuName')]",
"capacity": "[variables('skuCapacity')]"
},
"properties": {
"name": "[variables('hostingPlanName')]"
}
},
{
"apiVersion": "2015-08-01",
"name": "[variables('webSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Web/serverFarms/', variables('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]": "empty",
"displayName": "Website"
},
"properties": {
"name": "[variables('webSiteName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "config",
"dependsOn": [
"[concat('Microsoft.Web/Sites/', variables('webSiteName'))]"
],
"properties": {
"netFrameworkVersion": "4.5.2",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"requestTracingEnabled": true,
"httpLoggingEnabled": true,
"logsDirectorySizeLimit": 40,
"detailedErrorLoggingEnabled": true,
"appSettings": [
{
"name": "testn",
"value": "testv"
}
],
"connectionstrings": [
{
"name": "testn",
"value": "testv",
"type": "SQLServer"
}
]
}
}
]
}
],
输出是;
VERBOSE: Performing the operation "Creating Deployment" on target "testdeploy3".
VERBOSE: 4:44:42 PM - Template is valid.
...
VERBOSE: 4:45:17 PM - Resource Microsoft.Web/sites/config 'testwebadtzmdritygpo/web' provisioning status is succeeded
...
ProvisioningState : Succeeded
在门户中双重检查显示尚未创建 appsettings 和连接字符串
问题 1:如何使用 PowerShell 查询网站的配置属性?
问题 2:如何使用 ARM 将应用程序设置部署到网站?
【问题讨论】:
标签: powershell azure