Web.config Transformation

modelling

(pardhu.pillutla) #1

Hi octopus Team,

We are deploying a package on client’s machine and we want to do a web.config transformation. Our use case is like: there is a web.config on client’s machine and when deploying a package we want to compare the web.config on client’s machine to that in package. is that possible to do that? Below is the screen shot for your reference.

2nd Question:

I want to use the variable instead of hardcoding the release number. It should be generic to every release. We don’t want to change the release number every time when ever there is a release. Below is the screen shot for your reference.

Thank you,

Pardhu


(Reece) #3

Hi Pardhu,

Thanks for getting in touch,

It’s definitely possible within Octopus to accomplish this,

In this scenario, does the web.config file already exist on the client machine prior to deployment? Or is this included in a different package?

If the web.config exists in a different package, In order for this to work, you need to have the package containing the config transformation file deploy first, then the web.config package occur second with the Configuration Transform feature enabled in this same step. This is because you are required to define an absolute path in the Configuration Transformation as I’ve highlighted in my screenshots below;

In my example, web.release is the transform file and web.config is the config file that resides alongside the application.

(i.e. The ‘Deploy Transform Config File’ step contains web.release and the ‘Deploy Application and Config File’ contains web.config)

image

image

If the web.config file already exists in the target deployment location you should only need to enable the ‘Configuration transforms’ feature within your deploy package step and specify the target file.

You can find more information on our documentation regarding advanced configuration transformation examples listed below;

In regards to your second query, you should be able to use #{Octopus.Release.Number} as a system variable to have the this be the same as your release version.

Altenartively, if you are referring to your package version, you can use the system variable of #{Octopus.Action.Package.PackageVersion}

I hope this helps!

If I’ve misunderstood your query in any way or you require further assistance please let me know :slight_smile:

Kind Regards,

Reece


(pardhu.pillutla) #4

HI Reece,

Thanks for the reply! With regards to my 2nd question in my previous email I’m getting following error when creating the release. Please let me know the solution.

image

Thank you,

Pardhu . Pillutla


(Reece) #5

Hi Pardhu,

Thanks for getting back to me regarding this,

It looks like the variable for #{Octopus.Action.Package.PackageVersion} isn’t being resolved and this is leading to an invalid path error.

I think this due to the variable being split over two lines, can you try ensuring that the variable exists on the same line, as an example;

image

Instead of;

image

For both DACPAC Package Name and Publish Profile Name?

Let me know if this helps resolve the issue, I look forward to hearing back from you :slight_smile:

Kind Regards,

Reece


(pardhu.pillutla) #6

Hi Reece,

Thanks for getting back to me! I’m still getting the same error. If I want to use the new version of octopus in the dacpac step for (Extracting target database dacpac is not setting to false). I’m not sure about the issue.

Thank you,

Pardhu.Pillutla


(pardhu.pillutla) #7

Hi Reece,

Whenever dacpac deployment fails it is giving me the proper error message. Below is the screenshot for your reference.

Thank you,

Pardhu.Pillutla


(pardhu.pillutla) #8

Hi Reece,

I didn’t receive any reply email from you.

Thank you,

Pardhu Pillutla


(Reece) #9

Hi Pardhu,

Thanks for getting back to me, your patience is greatly appreciated.

I’ve had a look through this discussion and noticed that in your original query you mentioned;

I want to use the variable instead of hardcoding the release number. It should be generic to every release.

However, when I replied I outlined;

You should be able to use #{Octopus.Release.Number} as a system variable to have the this be the same as your release version

I noticed that in your provided example, that you are using #{Octopus.Action.Package.PackageVersion} instead of #{Octopus.Release.Number} to determine the folder path.

Using your original screenshot as an example, I would expect this to look like;

image

#{Octopus.Release.Version}\Database\Cybersoft.Primero.Data.Database.dacpac

Can I please confirm if this is intentional?

I look forward to hearing back from you :slight_smile:

Kind Regards,

Reece


(pardhu.pillutla) #10

Hi Reece,

Thanks for the reply! I’m still not able to run the dacpac. Below is the screenshot of error message.

image

Thank you,

Pardhu Pillutla


(pardhu.pillutla) #11

Hi Reece,

I have updated to latest version of octopus and I’ am facing lot of problems with that update. I’m unable to deploy a dacpac and when I try to uncheck the “Extract target database to dacpac” it is failing. I don’t want to use that. Please help me with this issue. We are ready to move to beta testing with octopus. We need it ASAP.

If it is possible to go back to previous version please help me with that.

Thank you,

Pardhu Pillutla


(Reece) #12

Hi Pardhu,

Thanks for getting in touch,

In your most recent query you mentioned that attempting to uncheck Extract Target Database to Dacpac is failing, are you referring to the original issue in which the value incorrect displays as True/False? As this was resolved in Octopus version 2018.2.3 or is this a new issue standalone issue that prevents you from selecting/unselecting the option entirely?

At this stage, it might be easier to troubleshoot an export of the project so we can look at this internally, you can use the Octo.exe tool (found in the Downloads area of our website and using the following steps you can export the project;

If you can send this export to support@octopus.com we can review this.

Kind Regards,

Reece


(pardhu.pillutla) #13

Hi Reece,

I have exported the project into a json file and I have emailed it to your support team. Please look into that. Please let me know if you need anything else from my side.

Thank you,

Pardhu Pillutla


(pardhu.pillutla) #14

Hi Reece,

We are testing Production releases with octopus and still are facing same old errors. When I try passing system variables instead of hardcoded package version number it’s throwing the below error. Please help me in solving this issue.

image

Thank you,

Pardhu Pillutla


(pardhu.pillutla) #15

Hi Reece,

Just following up, when can I expect the reply from support team so that I can give an update to my team. Please let me know if you need any other details from my end.

Thank you,

Pardhu Pillutla


(Reece) #16

Hi Pardhu,

Thanks for getting back to me, I appreciate you following this up. I unfortunately missed your original message, my apologies for the delay.

In order for this to work (since this an action-level variable), you would need to use an output variable to get the information from the previous package step, for example Octopus.Action[_name_].Output.Package.InstallationDirectoryPath

Alternatively, an easier solution available would be to create an output variable in the package step with a value of #{Octopus.Action.Package.PackageVersion} and then call that output variable in the DACPAC step (for example C:\Program Files\Cybersoft\Test\#{Octopus.Action[PackageStepName].Output.VarName}\Database\...etc)

I hope this helps!

Please let me know if you require further assistance with this :slight_smile:

I look forward to hearing back from you.

Kind Regards,

Reece


(pardhu.pillutla) #17

Hi Reece,

Thanks for the reply! I’m working on it. We have different versions of database dacpac in one database folder, for example if a customer is in 7.11 release and current release version is 8.4 then we need to run dacpac’s from 7.11 , 7.15. 8.0 so on up to 8.4. Please help me how I can use octopus to deploy those dacpac’s ? Below is the screenshot for your reference. All the dacpac’s are in one package. Please let me know if you need more information on this.

image

Thank you,

Pardhu Pillutla


(pardhu.pillutla) #18

Hi Reece,

I need further assistance on passing variables. I’m little confused.

Example:
C:\Program Files\Cybersoft\Test#{Octopus.Action[PackageStepName].Output.VarName}\Database…etc)

Thank you,

Pardhu Pillutla


(pardhu.pillutla) #19

Hi Reece,

Any update? I’m really sorry for disturbing you. We are very close to complete the final review of the tool. Please let me know if you need any other details.

Thank you,

PardhuPillutla


(Reece) #20

Hi Pardhu,

Thanks for your patience,

I’ve had to have a think about this, however, I believe this will work in the following scenario;

  1. Within the Deploy Package Step you can enable the Custom Deployment Scripts feature, using this you can produce Output Variables for the folder paths of the database script versions.

  2. The subsequent DACPAC steps can then use these variables to define the package name/publish profile name

As an example this would look like;

C:\Program Files\Cybersoft\Test#{Octopus.Action[Deploy Package Step (Need to Replace Name].Output.[1.7.0 (Variable to be Replaced with Version Output Variable]}\Database…etc)

I hope this helps!

Please let me know if you require further assistance, I’ll endeavor to get back to you ASAP.

I look forward to hearing back from you :slight_smile:

Kind Regards,

Reece


(pardhu.pillutla) #21

Hi Reece,

Thanks a lot for the response! I’m working on it. When I’m deploying SSRS using community template it’s overwriting SharedDataSource connection string and user name & password. Any other work around so that it cannot be over written?

Thank you,

Pardhu Pillutla