Asp.net mvc 如何在不登录Azure门户的情况下从Azure Web应用流式传输日志?
我将我的.Net应用托管在Azure Web应用中。是否有任何方法可以直接使用流式传输/查看应用程序/服务器日志跟踪,而无需登录门户。 我之所以需要这样做,是因为我的团队中包含了无法访问Azure门户的其他开发人员Asp.net mvc 如何在不登录Azure门户的情况下从Azure Web应用流式传输日志?,asp.net-mvc,azure,logging,azure-devops,azure-web-app-service,Asp.net Mvc,Azure,Logging,Azure Devops,Azure Web App Service,我将我的.Net应用托管在Azure Web应用中。是否有任何方法可以直接使用流式传输/查看应用程序/服务器日志跟踪,而无需登录门户。 我之所以需要这样做,是因为我的团队中包含了无法访问Azure门户的其他开发人员 A shared access signature (SAS) is a URI that allows you to specify the time span and permissions allowed for access to a storage resource suc
A shared access signature (SAS) is a URI that allows you to specify the time span and permissions allowed for access to a storage resource such as a blob or container. The time span and permissions can be derived from a stored access policy or specified in the URI. We’ll cover both of these in detail later.
如果对此有任何解决方案,请提供帮助。提前谢谢
我已尝试在Azure门户中启用日志流。但这不符合我的要求。
还尝试将日志存储到Azure存储帐户。但是找不到任何开源工具来获取和读取日志。而且觉得这是一个耗时的解决方案。实现这一点的最简单方法是使用存储帐户和容器进行应用程序和诊断日志记录 要为Azure web应用启用诊断,您可以执行以下操作:
- 在登录到您的帐户
- 转到Azure Web应用程序并选择设置>诊断日志
- 对于应用程序日志记录(Blob),单击并设置参数
- 设置日志记录的级别
- 对于存储设置,单击>并选择存储帐户和容器
- 对于Web服务器日志记录,请选择存储
- 单击存储设置,然后选择为应用程序日志记录设置的相同存储帐户和容器
A shared access signature (SAS) is a URI that allows you to specify the time span and permissions allowed for access to a storage resource such as a blob or container. The time span and permissions can be derived from a stored access policy or specified in the URI. We’ll cover both of these in detail later.
您可以参考以下文档。
希望能有所帮助。卫生部的建议很好,可能是最好的建议,但是: 我有一个建议,它不满足在Azure中没有角色的要求,但可能会提供这样一个优势,它可能是值得的。使用Azure CLI,您可以流式输出日志:
az webapp日志尾部--name appname--资源组myResourceGroup
您可以设置具有足够约束的角色,开发人员只需读取诊断日志即可:
另外,如果您不熟悉它,我建议您查看Azure Application Insights,它没有超低级日志,但可能足以诊断开发人员通常会遇到的问题。并且具有许多高级功能,使诊断比查看日志文件容易得多
同意如果不想像Leo建议的那样成为Azure角色,这是最好的选择+从我这里得到1。