如何使用Azure的资源管理器设置应用程序日志中的Azure中的webapp [英] How to set the application log in an Azure webapp using Azure resource manager

查看:981
本文介绍了如何使用Azure的资源管理器设置应用程序日志中的Azure中的webapp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何使用Azure的资源管理器(或Powershell的JSON)上Azure的Web应用程序设置下面的诊断设置。

Does anyone know how to set the below diagnostic settings on an Azure Web App using Azure Resource Manager (Powershell or JSON).

在这里输入的形象描述

使用以.json我只能找到这些设置。

Using .json I can only find these settings

     "requestTracingEnabled": true, /* Failed request tracing, aka 'freb' */
     "httpLoggingEnabled": true, /* IIS logs (aka Web server logging) */
     "logsDirectorySizeLimit": 40, /* 40 MB limit for IIS logs */
     "detailedErrorLoggingEnabled": true, /* Detailed error messages  */

在Web服务器日志果然到文件系统,但是不应用程序日志记录或Blob存储。

Which turns on web server logging to filesystem but NOT Application Logging or to blob storage.

使用PowerShell命令似乎只与ASM工作,因为它没有找到赋予它的非经典的存储帐户

With Powershell this command only seems to work with ASM as it does not find Non-classic storage accounts given to it

   Enable-AzureWebsiteApplicationDiagnostic

任何帮助将是AP preciated。目前,我们正在使用Azure的PowerShell的0.9.8

Any help would be appreciated. We are currently using Azure Powershell 0.9.8

问候

推荐答案

如果您浏览现有的Web应用程序在资源管理器你会发现一个配置/日志部分,看起来是这样的:

If you browse an existing webapp in Resource Explorer you'll find a config/logs section that looks something like this:

{
  "id": "/subscriptions/.../config/logs",
  "name": "logs",
  "type": "Microsoft.Web/sites/config",
  "location": "North Central US",
  "properties": {
    "applicationLogs": {
      "fileSystem": {
        "level": "Off"
      },
      "azureBlobStorage": {
        "level": "Information",
        "sasUrl": "...",
        "retentionInDays": 14
      }
    },
    ...
}

我相信你可以使用这种格式在你的模板的JSON配置日志记录。 (此部分将是一个兄弟姐妹,其中包含在问题中提到的设置配置/网络部分。)

请注意,虽然该配置/日志部分没有在<一个描述href=\"https://github.com/Azure/azure-resource-manager-schemas/blob/master/schemas/2015-08-01/Microsoft.Web.json\"相对=nofollow>的System.Web模式,所以我想像不被MS此时当前支持。我是pretty相信我已经试过了,看到它,虽然工作。

Note though that the config/logs section is not described in the System.Web schema, and so I'd imagine is not currently supported by MS at this time. I'm pretty sure I've tried it and seen it work though.

这篇关于如何使用Azure的资源管理器设置应用程序日志中的Azure中的webapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆