是否有一种方法可以使用PowerShell或ARM模板为azure应用程序服务启用应用程序日志记录到blob?

是否有一种方法可以使用PowerShell或ARM模板为azure应用程序服务启用应用程序日志记录到blob?,azure,azure-web-app-service,arm-template,Azure,Azure Web App Service,Arm Template,我们在azure门户中为azure应用程序服务启用应用程序日志记录到blob。有没有一种方法可以使用PowerShell或ARM模板来实现这一点。如果是,请提供示例代码 有没有一种方法可以使用PowerShell或ARM模板来实现这一点。如果是,请提供示例代码 我们使用powershell命令setazurermresource-Properties来实现这一点 我们还可以从https://resources.azure.com/。对我来说,它工作正常 Login-AzureRmAccount

我们在azure门户中为azure应用程序服务启用应用程序日志记录到blob。有没有一种方法可以使用PowerShell或ARM模板来实现这一点。如果是,请提供示例代码

有没有一种方法可以使用PowerShell或ARM模板来实现这一点。如果是,请提供示例代码

我们使用powershell命令
setazurermresource-Properties
来实现这一点

我们还可以从
https://resources.azure.com/
。对我来说,它工作正常

Login-AzureRmAccount   
# get the log setting
$logSetting = Get-AzureRmResource -ResourceGroupName "ResourceGroupName" -ResourceType Microsoft.Web/sites/config -ResourceName "webAppname/logs" -ApiVersion 2016-08-01  
$logSetting .Properties.applicationLogs.azureBlobStorage.level = "Error" 
$logSetting .Properties.applicationLogs.azureBlobStorage.sasUrl = "storage account sas token url"
$logSetting .Properties.applicationLogs.azureBlobStorage.retentionInDays = 3
# update the log setting
$result = Set-AzureRmResource -Properties $logSetting.Properties -ResourceGroupName "ResourceGroupName" -ResourceType Microsoft.Web/sites/config -ResourceName "webAppname/logs" -ApiVersion 2016-08-01 -Force

关于ARM模板,您可以参考此。

谢谢Tom的回复。很抱歉,由于时间限制,我无法实现它。