是否有可能使用Azure诊断无托管服务是 [英] Is it possible to use Azure diagnostics without being in a hosted service

查看:188
本文介绍了是否有可能使用Azure诊断无托管服务是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的解决方案多个Web和工人角色,但我也有运行一个非Azure应用程序在Azure中托管的虚拟机。该应用程序连接到像阅读和写作的斑点和队列各种事情Azure存储,并且工作正常。

I have several web and worker roles in my solution, but I also have a non-Azure application running on a Azure hosted VM. That application connects to Azure storage for various things like reading and writing blobs and queues, and that works fine.

我想使用Azure诊断来自同一个应用程序(在虚拟机上运行的.net应用程序中的Azure托管)之内。但是,如果我尝试初始化诊断我得到一个异常:

I'd like to use Azure diagnostics from within that same application (a .NET app running on a VM hosted in Azure). However, if I try to initialize diagnostics I get an exception that:

System.InvalidOperationException:在托管服务或开发面料不运行

System.InvalidOperationException: Not running in a hosted service or the Development Fabric.

这是有道理的,但我不知道是否有可能使用某种方式诊断没有被托管服务。特别是,我使用Azure诊断收集日志信息,通过System.Diagnostics.Trace写出来,而这一切从应用code隐藏起来,所以如果有一些其他的API我有一个地方,我也许可以槽,在

This makes sense, but I'm wondering if it's possible to use the diagnostics in some way without being a hosted service. In particular, I'm using azure diagnostics to gather logging information, written out by System.Diagnostics.Trace, and that's all hidden away from the application code, so if there were some other APIs I have a place I can probably slot that in.

任何想法?
谢谢,
JC

Any ideas? Thanks, JC

推荐答案

不幸的是,没有。至少不是今天。代理先后为RoleEnvironment一些东西硬codeD检查,当它不存在,它失败。这也是你不能在IaaS的东西使用代理或者今天的原因。

Unfortunately, no. At least not today. The agent has some hard-coded checks for the RoleEnvironment stuff and when it is not there, it fails. This is also the reason you cannot use the agent in the IaaS stuff today either.

这篇关于是否有可能使用Azure诊断无托管服务是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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