I play with this sample role in the azure region . It contains a class derived from RoleEntryPointand an .aspx page containing a button click handler.
I am testing it in Azure Emulator. I put the following code (taken from here )
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
both in the role OnStart()and in the button handler. When a function is called OnStart(), it is launched in WaIISHost.exeunder the account MachineName\\MyLogin, and when the button handler code is called, it is launched in w3wp.exeunder the account MachineName\\NETWORK SERVICE. It is amazing.
Why are these pieces of code from the same role project executed inside different processes and under different accounts? Can i change this?
source
share