Set ARM Template Web appSetting
Wie kann ich mit ARM Anwendungseinstellungen auf einer Website bereitstellen?
1 Wenn Sie in VS ARM Deploy json Folgendes ausführen:
....
"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"
}
]
}
}
]
}
],
Ausgabe ist;
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
Doppelprüfung im Portal zeigt, dass Appsettings und Connectionstrings NICHT erstellt wurden
Frage 1: Wie frage ich mit PowerShell die Konfigurationseigenschaften einer Website ab?
Frage 2: Wie kann ich mit ARM Anwendungseinstellungen auf einer Website bereitstellen?