MicroMan
MicroMan

Reputation: 2098

Replace appsettings and connection strings Octopus Deploy

I am using Octopus deploy to replace appsettings and connectionstrings

In my web.config i have the following these files are excluuded from checkin

<appSettings configSource="MyLocalAppconfig" > </appSettings> 
<connectionStrings configSource="MyLocalDB.config"> </connectionStrings>

Then in my web.release.config

i have the following

  <appSettings>
    <add key="AppSetting1" value=""/>
    <add key="AppSetting2" value=""/>
  </appSettings>
  <connectionStrings>
    <add name="MyDB1" connectionString=""/>
  </connectionStrings>

In Octopus I have variables setup with the same name. I also have the following steps ticket in the deployment

enter image description here

But when I deploy Octopus says

No matching appSetting, applicationSetting, nor connectionString names were found in: C:\Octopus\Applications\XXX\XX\1.0.1\Web.config

Upvotes: 1

Views: 3439

Answers (2)

Joe Phillips
Joe Phillips

Reputation: 51200

You are not using valid XDT. You have to tell it how to transform those. In your case, you want to insert them since they don't exist in the original file.

Upvotes: 1

Emiel Koning
Emiel Koning

Reputation: 4225

Are you sure the Web.release.config is part of your package? The NuGet Package Explorer is very convenient for viewing the contents of your package. (you could also add .zip extension to the package file name (or rename .nupkg to .zip) and it will just open when you double click it).

Maybe what you're seeing is collateral damage. No Web.release.config was found, so no transformation took place at all... so there are no appSettings or connectionStrings.

Upvotes: 0

Related Questions