Folder deleted after completion of step

Hello,

I’m using Web Deploy - Publish Website (MSDeploy) step from the library. This step uses the work folder of the previous Deploy nuget package step. But when the web deploy step is starting the folder of the previous step is already deleted. How can I prevent the folder to e deleted?

Error:
Publishing Website
Exception calling “CreateObject” with “2” argument(s): “Could not find file ‘C:
\Octopus\Work\20151211110341-10’. Learn more at: http://go.microsoft.com/fwlin
k/?LinkId=221672#FileOrFolderNotFound.”

Thanks,

Arjan

Hi Arjan,

Thanks for reaching out. That step template doesn’t use the the work folder of the Nuget Deploy step, it uses the InstallationDirectoryPath. Unlike the working folder, the InstallationDirectoryPath is not deleted at the end of the deployment. You can get the full path from a subsequent step using the variable below

$OctopusParameters["Octopus.Action[DeployStepName].Output.Package.InstallationDirectoryPath"]

Hope that helps
Dalmiro

Hi, I am having same problem, but looking at the output, it looks like the MSDeploy Step is using the “Work” folder, but the file it’s expecting isn’t there.

True v2.0.50727 C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Web.Deployment…
11:03:18Info
Finding path to package step: Nuget
11:03:19Info
Package was installed to: D:\Octopus\Work\20160211110217-24
11:03:19Info
Skipping delete actions on App_Data
11:03:19Info
Publishing Website
11:03:19Verbose
Exception calling “CreateObject” with “2” argument(s): "Could not find file
11:03:19Verbose
’D:\Octopus\Work\20160211110217-24’. Learn more at:

Hi Graham,

Thanks for getting in touch. Could you tell us which version of Octopus are you running and send us a deployment log?

Thanks,
Dalmiro

Hi - running 3.2.22, attached is a log.

G

ServerTasks-32.log.txt (1 MB)

Hi Graham,

Thanks for sharing that info. May I ask why are you using that MSDeploy step template? I’m asking because 95% of that step’s users used to use it to deploy to Azure, and as of Octopus 3.1 we offer way better support for Azure deployments right out of the box.

Is there a specific reason why you want to use that step template?

Best regards
Dalmiro

No, just found an article online… All I want to do is package and deploy to an azure website. If I can do without that template then great. Do you have a pointer to an updated doc?

Sent from my iPad

Graham - There you go: http://docs.octopusdeploy.com/display/OD/Deploying+a+package+to+an+Azure+Web+App

Let me know if you need any help with that. Its much easier to use (and better supported by us) than the step template.

Many thanks for the prompt reply. Having done this, I have just noticed a
"we’re going to deprectate Azure web apps as a target", so can I share with
you my set up so I can make sure I am doing this right going forward?

I run a small saas product, with each customer having their own db and
azure web app. They all run the same code, but I want to be able to deploy
to all or selected customers in a manner determined by the features
released, so:

Customer 1 - Web App 1 + SQL DB 1
Customer 2 - Web App 2 + SQL DB 2

etc

In the previous way, I could set up each of my customer as an "Environment"
then choose which ones get any new Release I create. Can you share how I
can achieve this without Environments, as it looks like I would need to
create 1 Project for each Customer (and create releases for each), making
managing versions even more complicated? Am I missing something?

G

Hi Graham,

What you are looking for is actually a feature we are developing right now for 3.4: https://octopus.com/blog/rfc-multitenancy . This exactly fits your scenario.

Right now the easiest way to manage you multi-client scenario would be to either:

A) Use a Channel per customer with channel-scoped variables for db connection strings and that kind of stuff. This will allow you to use a single project for all of your customers.

More info about Channels: http://docs.octopusdeploy.com/display/OD/Channels

B)Stay with the multi-environment approach.

Best regards,
Dalmiro

Hi,

Thansk for the info. Are you going to deprecate the Azure target before
3.4 - i.e. shall I start using this then migrate to the new model when 3.4
is out. Do you have an indicative timeframe?

G

Hi Graham,

We released 3.3 a couple of hours ago, and that one still has Azure Targets. We haven’t discussed yet when we are gonna deprecate them.

In any case, the best thing to do would be to stop using Azure Targets right now, and move to the dedicated Azure Steps.

Best regards,
Dalmiro