【发布时间】:2016-05-12 23:40:59
【问题描述】:
我正在尝试使用“Set-AzureRmResource”在 Azure 中配置 WebApp 配置。
我这里有一段代码可以设置“alwaysOn = True”:
$PropertiesObject = @{
"alwaysOn" = $true;
}
Set-AzureRmResource -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/config -ResourceName $SiteName/web -ApiVersion 2015-08-01 -Force
### in this case "alwaysOn' sits within "properties": {.
我现在想设置另一个属性,但是这个是嵌套的。例如:
"azureBlobStorage": {
"sasUrl": null,
"retentionInDays": null,
"enabled": false
}
### in this case I want to set SasUrl which sits within "properties"{ AzureBlobStorage {
我不知道用来设置像这样嵌套的属性的语法。
对不起,如果我的术语不正确,powershell 和 Json 对我来说很新,我边走边学。
Azure 文档简单说明:
# SET web
$PropertiesObject = @{
#Property = value;
}
#
"properties": {
"httpLogs": {
"fileSystem": {
"retentionInMb": 35,
"retentionInDays": null,
"enabled": false
},
"azureBlobStorage": {
"sasUrl": null,
"retentionInDays": null,
"enabled": false
}
},
【问题讨论】:
-
另请注意
azureBlobStorage在$SiteName/logs下,而不是$SiteName/web。
标签: azure azure-web-app-service