Octopus Deploy not setting IIS authentication mode

I have checked the “Enable Windows Authentication” checkbox, but the flag is not respected. “Anonymous auth” is always set after deploy. Windows Auth is also set in Web.config, to no effect.

We have two steps in the deploy process, as described in the screenshots. The first step creates the IIS application, the second deploys it – with XML transforms.

What am I missing?

PS. we are running version 2.6.0.778

Hi,

Thanks for reaching out. It seems like you have both IIS + Home directory and IIS web site and application pool features enabled, which are not compatible. Not sure if that would cause these issue, but its worth trying just with the 2nd one.

Please follow these steps:

  1. Disable the feature “IIS + Home Directory” (see disable.jpg)
  2. Enable the feature “Create or update…” shown on website.jpg
  3. Enable the debugging variables on your project http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables
  4. Create a new release and deploy it
  5. Check if the windows authentication was set. If not, send us the deployment log http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks

Dalmiro

“IIS + Home Directory” was the problem. I disabled it, and now it works as expected. Thank you!

Hi again,

Unfortunatly this was not as easy as I hoped. I suddenly remembered why I activated “IIS + Home Directory” to begin with:

With this disabled, Octopus no longer updated the Physical path setting in IIS. After deploy it does not point to the unpackaged release. Instead, it points to the path we set in Step 1 (physical path). Earlier this was just ApplicationDirectoryPath\EnvironmentName.

I thought I could use some sort of “installation folder”-variable here, but I can’t find any variable for this purpose. I tried using the Output.Package.InstallationDirectoryPath, but that is not populated at this point in time,

I tried building a path manually (ApplicationDirectoryPath / Env name / NuGetPackageId / PackageVersion), but this had two issues. First, Step 1 don’t work for a folder that does not exist. Second, if we deploy the release multiple times, the folder will have an increasing postfix (_2, _3, _4).

As I see it, I have to choose between manually setting Windows Auth, or manually setting Physical Path. Hope there exists a better solution? :slight_smile:

Øyvind

Hi Øyvind,

Could you pleas enable the debugging variables, then create a new release and share me the deployment log? Also please tell me which is the path you expect the site to point after the deployment

http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables

http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks!

Dalmiro

Sure.

Expected physical path:
C:\Octopus\Applications\Test\NRK.OnDemand.Foss.Web\1.0.150512.2-dev

Actual physical path:
C:\Octopus\Applications\Test\

If I try to create a new deploy with the same package, expected folder would be:
C:\Octopus\Applications\Test\NRK.OnDemand.Foss.Web\1.0.150512.2-dev_2

ServerTasks-12254.log.txt (209 KB)

The feature “IIS web site and application pool” without “IIS + Home Directory” should be enough to achieve this.

Are you deploying this to the same machine every time?

If possible, could you trigger another deployment for the exact same package and also send me the raw log? I want to compare it with the one you just sent.

Thanks!

Dalmiro

Hi,

Sorry for the delayed answer.

I ran two new deploys back to back with the same package. Same problem. Both deploy logs attached.

Øyvind

ServerTasks-12480.log.txt (209 KB)

ServerTasks-12481.log.txt (209 KB)

Hi Øyvind

Acording to your deployment logs the following happened:

12480
Install dir: Home directory: C:\Octopus\Applications\Test\NRK.OnDemand.Foss.Web\1.0.150512.2-dev_2
Windows auth: Windows authentication enabled: True

12481
Install dir: Home directory: C:\Octopus\Applications\Test\NRK.OnDemand.Foss.Web\1.0.150512.2-dev_3
windows auth: Windows authentication enabled: True

This seems to have correctly increased the folder name to _+1 and also set windows auth on for your site. Which of these things did not happen? Could you send us screenshots of the auth page on and site path on IIS?

Dalmiro