DEPLOY TO IIS step not setting AppPool to run under custom user account

Hi

I have a DEPLOY TO IIS step that is not working correctly. The Application Pool section of the step has Identity set to Custom User and i am supplying a Username and Password. I would expect that after running the step the ApplicationPool would be running under the account specified in Username but it is running under ApplicationPoolIdentity. This occurs wheather the ApplicationPool is created by the step or is a preexisting ApplicationPool that was already configured to run under the account specified in Username. In both cases the ApplicationPool is running under ApplicationPoolIdentity after the step has run. I’m using octopus server v2023.1 and deploying to windows server 2022 running IIS 10.
Here is the logs section around the application pool configuration

Invoking target script E:\inetpub\wwwroot\i-conX\CustomerWebsites\VF.MT\23.1.1850\Octopus.Features.IISWebSite_BeforePostDeploy.ps1 with  parameters. 
Detected IIS Version 10.0 
Making sure a Web Application "/VF.MT" is configured as a child of "Default Web Site" at "E:\inetpub\wwwroot\i-conX\CustomerWebsites\VF.MT\23.1.1850"... 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Looking for the parent Site "Default Web Site" at "IIS:\Sites\Default Web Site"... 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Loading Application pool 
Application pool "DefaultAppPool" already exists 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Set application pool identity: ApplicationPoolIdentity 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Set .NET framework version: v4.0 
Web Application "/VF.MT" already exists, no need to create it. 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Setting physical path of IIS:\Sites\Default Web Site\VF.MT to E:\inetpub\wwwroot\i-conX\CustomerWebsites\VF.MT\23.1.1850 
Acquired mutex Global\Octopus-IIS-Metabase-Mutex 
Loading Site 
Assigning "IIS:\Sites\Default Web Site\VF.MT" to application pool "DefaultAppPool"... 
IIS configuration complete

Thanks, Jonathan

Good afternoon @jonathan.keaveney,

Thank you for contacting Octopus Support and welcome to the forums!

I am sorry it looks as though your application pool is not setting the identity to the custom user.

I have just tested this on my end (using 2023.2.12868) and I can confirm the step works as it should and did create the app pool with the custom user:

I tested this with the DefaultAppPool too and it does work as expected, it did take a few minutes for it to change in IIS though:

I tried this with a non-domain account and it worked fine too and changed the DefaultAppPool.

When I come back from lunch ill spin up your version to ensure it is not a bug with an earlier version - can you confirm your full Octopus version please, so 2023.1.xxxx

Can you also confirm your IIS is not just lagging behind and it has actually changed it, if you right click on the app pool and click on Advanced Settings and then scroll down to Process Model > Identity has it changed it in there?

Once I have your full Octopus server version and I am back from lunch I will spin up that version and see if it is a bug.

Kind Regards,
Clare

Hi Clare

Thanks for coming back on this. I created a new release and the deployment worked fine. It must have been that the step had changed but the release was using the previous version of the step before I set the Custom user. All looks fine. Thanks for your help on this.

Jonathan

Hey Jonathan,

No worries at all, glad you got this working, reach out in future if you need anything else as we are always on hand to help!

Kind Regards and Happy Deployments,
Clare

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.