简体   繁体   English

Azure Worker角色未运行?

[英]Azure Worker Role not Running?

I'm new to Azure so this may be something obvious that I'm missing. 我是Azure的新手,所以这可能是我想念的明显事物。 I created a new Azure Cloud Service project and added a web role and worker role. 我创建了一个新的Azure Cloud Service项目,并添加了一个Web角色和辅助角色。 In the web role I upload a file to blob storage. 在web角色中,我将文件上传到blob存储。 That part works fine. 那部分工作正常。 As part of that that process I added a message to the azure message queue. 作为该过程的一部分,我向azure消息队列添加了一条消息。 In my worker role I'm checking for a message in the queue. 在我的worker角色中,我正在检查队列中的消息。 The issue is the worker role does not appear to be working. 问题是工作者角色似乎没有起作用。 In debug mode I put in a break point and it never gets hit. 在调试模式下,我放入一个断点,它永远不会被击中。 Is there a step that I am missing that starts the worker role or something? 是否有一个我失踪的步骤,启动工人角色或什么?

You need to run the Azure project itself, not the individual roles. 您需要运行Azure项目本身,而不是单个角色。
This will start all of the roles in the Azure development fabric. 这将启动Azure开发结构中的所有角色。

Can you share the code for your worker role's OnStart() method. 你可以共享你的worker角色的OnStart()方法的代码。 One thing I can think of is that your role's OnStart() method is terminating which should not be happening. 我能想到的一件事是你的角色的OnStart()方法正在终止,这不应该发生。 There should be an infinite loop inside your worker role's OnStart() method inside which you will need to repeatedly call the function which checks the queue status. 你的worker角色的OnStart()方法中应该有一个无限循环,你需要在其中重复调用检查队列状态的函数。

If you run the Azure project, it will automatically initiates the roles. 如果您运行Azure项目,它将自动启动角色。 If you want to debug, then enable intelli trace and debug your application in development fabric. 如果要进行调试,请在开发结构中启用智能跟踪和调试应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM