microsoft / iis-docker

Dockerfile for IIS
https://hub.docker.com/r/microsoft/iis/
MIT License
293 stars 129 forks source link

Anyone get Application Initialization working? #156

Closed Tim-Co closed 4 years ago

Tim-Co commented 5 years ago

Here's my dockerfile set up..

RUN powershell.exe -NoProfile -Command Add-WindowsFeature Web-AppInit; `
        Import-Module WebAdministration ; `
        Set-ItemProperty 'IIS:\AppPools\DefaultAppPool' -name startMode -Value AlwaysRunning ; `
        Set-ItemProperty 'IIS:\Sites\Default Web Site' -name applicationDefaults.preloadEnabled -Value True ;

Here's my web.config...

<system.webServer>
      <applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
        <add initializationPage="/forms/assignmentqueue.aspx" />
      </applicationInitialization>
</system.webServer>

I can't get the application initialization to work. Anyone have any luck with this?

sstockhammer commented 5 years ago

Bump. Same here.

I've made every single adjustment possible and checked all the settings. Nothing seems to get ApplicationInitialization working.

Any info from one of the contributors? @mbrown555

Cloudmersive commented 5 years ago

This is an important issue. Why is it not being addressed?

bariscaglar commented 5 years ago

@jhkimnew can you take a look?

jhkimnew commented 5 years ago

@Tim-Co @sstockhammer

Did you try to enable IIS FREB for all the status code (200-999) and then check if the configured initializationPage request (/forms/assignmentqueue.aspx) was found in one of the generated freb logs?

FYI, if you checked only the IIS log file, you won't be able to see the initializationPage request from the IIS log file and you can be confused because of that. As far as I know, only IIS FREB shows the initializationPage request.

jhkimnew commented 5 years ago

BTW, here is how to enable IIS Freb tracing on container and I also confirmed IIS Freb works on container with looking at the Freb logs.

  1. Install IIS Freb with running below command:
    Add-WindowsFeature Web-Http-Tracing
  2. Enable Freb for Default Web Site with running below command:
    Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/sites/site[@name='Default Web Site']/traceFailedRequestsLogging" -name "enabled" -value "True"
  3. Configure Freb settings for the web.config of the Default Web Site as the following example: NOTE: if you did not install ASPNET module, you need to remove the ASP, ASPNET and ISAPI Extension" provider. Otherwise, you will get 500 errors.
    ...
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose" />
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                        <add provider="ISAPI Extension" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions statusCodes="200-999" />
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
    </configuration>