How does this happen? Are Azure webpage entry point and .aspx page handler running in different processes?

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?

+3
source share
2 answers

David is right. In addition to this, you can disable this behavior and run everything in the web kernel for the host (as it was before the SDK 1.4). You just need to comment on the Sites section of the service definition, as in the example below:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="aExpense.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
  <WebRole name="aExpense" vmsize="Medium">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="HttpsIn" endpointName="HttpsIn" />
        </Bindings>
      </Site>
    </Sites>
    <ConfigurationSettings>
      <Setting name="DiagnosticsConnectionString" />
      <Setting name="DataConnectionString" />
      <Setting name="allowInsecureRemoteEndpoints" />
    </ConfigurationSettings>
+3
source

On Windows Azure version 1.3 and later, the web role uses full IIS, not Hosted Web Core. IIS runs in a separate application.

See this blog post from the Windows Azure team for details.

+3
source

All Articles