I find this really frustrating. Are you sure that this is only the security group in which the executing user works? You check this with RDP in the machine, or just expect startup tasks. Because if you are RDP and you are doing something there, it is executed in the context of the connected user, and I have never seen any of the RoleEnvironment variables available in my context when I am RDP.
However, I have an offer for you. While the individual role of the worker may be excessive, how about just implementing RoleEntryPoint in the same WebRole? This is a fully valid and supported scenario. And I saw how many customers do it. Just create a public class inside your WebRole that inherits from RoleEntryPoint, overrides the methods you want (OnStart, OnStop, Run or even less) and you're done. The only tiny caveat is that if you need a configuration file, web.config will not help. But you have to add the WaaIISHost.config file where you can put all the configuration related to the code that works in RoleEntryPoint.
Now you will have the whole context that you need, all the configurations you need, all the resources you need, and will work in the same Web role. With improved diagnostics, troubleshooting and debugging options, and then with a scheduled task.
source share