IIS - Change App Offline: InstallationFolder usage?

I’m using the Step Template called “IIS - Change App Offline” in order to switch my IIS website into maintenance mode. However, it asks for a field called InstallationFolder, and I can’t infer the exact usage from the script.

Any ideas on how to configure this field, given that an absolute file path will be different for each server and each version of the site?

Hi Eric,

Thanks for getting in touch! We are a little unsure ourselves here, the step templates are community made, though I have not seen anyone asking about this. We are going to look into this. In the mean time, I think the best idea would be to reference the following StackOverflow comment for a good way to take your website offline during your deployment.

It is also possible that the author of that Step template or a member of the community will replay with some helpful information.

Hope that helps. Let me know if you have any further question or if we are getting something wrong here. :slight_smile:

Best regards,
Daniel

Thanks for the feedback. I’m guessing I’m a noob, because I’m trying to make sense of the variables in the powershell scripts in that link and not getting my head around it.

My deployment involves five websites that need to go offline. There seem to be two variables in that script: $WebSiteName and $WebDeployPath. I’ve added the powershell script as a step at the top, but I can’t see how those variables are being populated, since the powershell step doesn’t have a link to a specific site. Alternately I can replace those variables with literal values, but where would $WebDeployPath come from, since a literal file path would probably involve package version numbers right?

Hi Eric,

Thanks for getting back. So I had another big chat with the devs here and we have some more thoughts that are contradictory to my previous response. The PowerShell in the stack-overflow post may be unnecessarily complicating things.

In regards to the step template, you should be able to use the InstallationFolder parameter by entering a Custom Installation Directory. The InstallationFolder parameter is the path that your app is installed to.

A link to our documentation on using a Custom Installation Directory.

If you are not using a custom installation directory, you should be able to use the following Octopus system variable.
#{Octopus.Tentacle.PreviousInstallation.OriginalInstalledPath}

Let me know if this new information helps you out. And sorry for any confusion I may have caused. Let me know if you have further questions.

Best regards,
Daniel

Thanks Daniel. The problem with the variable you mentioned is that you don’t know which site it’s for (unless I read wrong).

I’ve modified the step template to allow you to provide an IIS site name, which will then look up the file path via IIS and use that to find the app_offline page. I’ve attached the export and you can include it in your community library if you like.

IIS_-_Change_App_Offline_by_Site_Name.txt (3 KB)

Hi Eric,

Thanks for getting back! And thanks for sending through your modification, I’m sorry that my solution didn’t really help you out.

I have passed it onto our developers to have a look at. :slight_smile:

Thanks again,

Best regards,
Daniel