RoleEnvironment.Changing event does not fire in WorkerRole

So I have an Azure project with 3 WebRoles and 1 WorkerRole. In each project, I have a subscription to the RoleEnvironment.Changing and RoleEnvironment.Changed events. In WebRole everything is fine, but in WorkerRole these events do not want to be triggered.

When I change the setting of some WebRole, WorkerRole also recycles every time

WorkerRole launches another x86 process inside and script on startup

Used Azure SDK 1.7

<WorkerRole name="MyService" vmsize="Medium" enableNativeCodeExecution="true"> <Startup> <Task commandLine="startup.cmd" taskType="simple" executionContext="elevated" /> </Startup> <Runtime executionContext="elevated" /> <Imports> <Import moduleName="Diagnostics" /> <Import moduleName="RemoteAccess" /> </Imports> <Endpoints> <InputEndpoint name="Endpoint1" protocol="http" port="8081" /> <InputEndpoint name="TCPEndpoint" protocol="tcp" port="10101" localPort="10100" /> <InternalEndpoint name="InternalEndpoint" protocol="http" /> </Endpoints> <ConfigurationSettings> <Setting name="StorageConnectionString" /> <Setting name="TransactionLogsBlobContainer" /> </ConfigurationSettings> <LocalResources> <LocalStorage name="DiagnosticStore" cleanOnRoleRecycle="false" sizeInMB="8192" /> </LocalResources> </WorkerRole> 

Does anyone know what might happen?

thanks

+4
source share
2 answers

I had a similar problem, and it turned out that changing the taskType task from elevated to background solves my problem. I would recommend starting there.

 <Startup> <Task commandLine="startup.cmd" executionContext="elevated" taskType="background"></Task> </Startup> 
0
source

For work roles, you must define an internal endpoint (even if you are not actually using it) in order to receive certain events.

IE, add this to your CSDef:

More details here: http://blogs.msdn.com/b/windowsazure/archive/2011/01/04/responding-to-role-topology-changes.aspx

0
source

All Articles