Issues with IIS deployment

I am starting to use the new “IIS web site and application pool” feature in Octopus Deploy 2

My site is packaged into a NuGet package (ASP .NET). In Octopus Deploy I setup the feature with pretty much default settings, except for web site name and application pool name.

When deploying the package, I get:

"start-webitem : Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)
At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:141
char:5

  • Start-Website $WebSiteName
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:slight_smile: [Start-WebItem], COMExcept
      ion
    • FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartItemCommand
      Script ‘C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1. Deployment terminated."

The problem seems to be that there is already a default website installed on the same port. Stopping the website fixes this issue.

After solving this issue, I can browse the website, however with permission errors (tried both Network Service and ApplicationPoolIdentity):
Access to the path ‘C:\Applications\Production\website\0.XX\foo.config’ is denied

Shouldn’t stuff like this work pretty flawlessly in Octopus Deploy?

Some background, I am using a fresh EC2 instance with Windows Server 2012, and I have installed Web-Server feature with the powershell command “Add-WindowsFeature Web-Server -IncludeAllSubFeature”

Hi Morten, thanks for the info.

“Flawless” is the goal, but IIS configuration is tough on a wide range of versions and configurations, so we’re still working through some rough edges like these.

I’ve added your comments to: https://github.com/OctopusDeploy/Issues/issues/430 - hopefully this issue illustrates our goals of having the best out-of-the-box IIS configuration experience there can be :slight_smile:

Cheers,
Nick