I'm playing with this Azure web role sample. It contains a class derived from RoleEntryPoint
and a .aspx page that contains a button click handler.
I test it in Azure Emulator. I put the following code (taken from here)
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
in both role OnStart()
and the button click handler. When role OnStart()
is invoked it happens to run in WaIISHost.exe
under MachineName\MyLogin
account and when button handler code is invoked it happens to run in w3wp.exe
under MachineName\NETWORK SERVICE
account. That's surprising.
Why are these pieces of code from the same role project run inside different processes and under different accounts? Can I change that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…