question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable substitution for ApplicationSettings not working

See original GitHub issue

It seems that while appSettings are correctly substituted, applicationSettings are not.

Her in xmlvariablesubstituionutility.ts the code is iterating through a set of tags.

https://github.com/Microsoft/vsts-tasks/blob/a698fb593f58fe733df94aa166a99ed3ea6dda5b/Tasks/Common/webdeployment-common/xmlvariablesubstitutionutility.ts#L84

There appears to be special case code for configSections and connectionStrings https://github.com/Microsoft/vsts-tasks/blob/a698fb593f58fe733df94aa166a99ed3ea6dda5b/Tasks/Common/webdeployment-common/xmlvariablesubstitutionutility.ts#L125

and the rest of the code goes to updateXmlNodeAttribute https://github.com/Microsoft/vsts-tasks/blob/a698fb593f58fe733df94aa166a99ed3ea6dda5b/Tasks/Common/webdeployment-common/xmlvariablesubstitutionutility.ts#L178

It looks like updateXmlNodeAttribute is really designed for appSettings structures as:

<appSettings>
<add key="blat" value="blart"/>
</appSettings>

and not applicationSettings structures which look like:

<applicationSettings>
  <myCustomSection>
   <setting name="blat" serializeAs="String">
      <value>blart</value>
   </setting>
  </myCustomSection>
</applicationSettings>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:22

github_iconTop GitHub Comments

1reaction
Ajay-MScommented, Jan 18, 2018

We have skipped deployment of one release (M128) in between. Deployment of release M129 has been started and will be available in next 2 weeks to almost all rings.

Though I will not recommend to run a pre release version. But for you info in case of it’s blocking you below are the steps to achieve it.

Deploying copy of task by changing Task Id

  1. Clone vsts-tasks repo
  2. Open task.json file of Azure App Service task and change task Id guid
  3. Build task by running command - gulp build --task AzureRmWebAppDeployment
  4. Deploy task using tfx cli => tfx build tasks upload --task-path <Path of task build>
0reactions
shaneholdercommented, Feb 8, 2018

Success!!! THANK YOU SO MUCH!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variable substitution for ApplicationSettings not working #5595
It seems that while appSettings are correctly substituted, applicationSettings are not. Her in xmlvariablesubstituionutility.ts the code is ...
Read more >
XML variable substitution not working for some variables ...
XML variable substitution not working for some variables. ... I have two appSettings that both have empty default values and neither of them...
Read more >
Variable substitution does not work in Web.Config section
The feature 'XML variable substitution' only works for applicationSettings, appSettings, connectionStrings, and configSections.
Read more >
File transforms and variable substitution - Azure Pipelines
You can use the File Transform task to apply file transformations and variable substitutions on any configuration and parameters files.
Read more >
Problem with Substitution variable - Execution - Octopus Deploy
Hello, I'm using the Octopus variable substitution feature on a .config file in my .NET application. The problem is that I am able...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found