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: ( [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."
- CategoryInfo : InvalidOperation: ( [Start-WebItem], COMExcept
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”