AWS Elastic Beanstalk ebextensions: Update the IIS App Pool using commands to another App Pool Identity

So I had a .Net application that needed to leverage the Network Service application identity instead of the OOB ApplicationPoolIdentity that comes with a default shipped EBS windows server with IIS. The solution? An ebextenion of course!

0) We’re going to have a step 0 assuming you already have a development AWS account with credits to push servers to Elastic Beanstalk. If you have not do this part then do some reading here:

1) Once you have an account and have configured your Visual Studio environment to your account appropriately then proceed to open your VS solution.

2) Create a folder in your solution called .ebextensions

3) Create your config file (if you don’t have an editor Notepad++ will do) within that folder and edit it in YAML format

The following example below will update the DefaultAppPool app identity to Network Service leveraging powershell and the commands/command features:

    content: |
      Write-Verbose 'Update the application pool'
      Set-Location C:\\Robo
      import-module WebAdministration
      Set-ItemProperty IIS:\AppPools\DefaultAppPool -name processModel.identityType -value 2
    command: powershell.exe -ExecutionPolicy Bypass -File "C:\\Robo\\Update_App_Pool.ps1"
    ignoreErrors: False
    waitAfterCompletion: 0	

4) Save the Deploy this with your application into EBS you should see the updated app pool identity as the application is deployed.

Hope this helps. Questions are welcome!

If you want to venture deeper into this then start here:

Validate here:


Questions? Comments?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s