Closed shaneholder closed 6 years ago
@shaneholder
Two different JSONs that you have shared corresponding to xmlDom being created by ltxdomutility.ts are actually for two different purposes.
Your first JSON is corresponding to xml variable substitution for your web.config file. Code reference - Initialize XmlDom for Config File
Second JSON is corresponding to xml variable substitution in your parameters.xml file present in your package. Code reference - Initialize XmlDom for parameters file
I have verified that config section variable substitution in working fine.
You might be facing issue probably due to some other reason. We can debug into that issue.
Can you please share your email id so that we can arrange a call to look into this issue.
@Ajay-MS how are you verifying the config sections are being replaced correctly? I pulled down master this weekend and ran the L0 tests in AzureRmWebAppDeployment which run the L1XdtTransform tests and those tests do not have any checks for transformations of the configSections. Perhaps I am looking at the wrong tests?
I have executed task and provided a package with web.config and web.config contains a config section. After execution I have figured out all values that I have specified corresponding to config section are getting replaced properly.
Another point, in your recent comment you have mentioned that you are running test corresponding to XDT traspformation.
Please try L0 corresponding to XML variable substitution. https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/Common/webdeployment-common/Tests/L1XmlVarSub.ts
Though this file currently don't have any variable from config section. For your testing you can add one variable for config section too.
I referenced the wrong tests in my most recent post, I am working with the L1XmlVarSub tests. I will run the tests again and post more detailed results.
This has been fixed in #5912. It will be available with the next deployment which will take around 2 weeks to get to all accounts. Issue #5595 will be tracked separately, hence closing this.
This is in relation to https://github.com/Microsoft/vsts-tasks/issues/5595
I have pulled down the code and I am trying to generate a fix for the above code but I'm having issues with the basic substitution code.
It seems that when connectionStrings are substituted the xmlDomLookUpTable is being modified, and subsequent lookups do not succeed so configSections never finds a node.
I've added logging to ltxdomutility.ts and xmlvariablesubstitutionutility.ts
What I see is that before the system does substitution on connectionString the xmlDomLookUpTable contains...sorry for this it's a ton of JSON, but I want to provide full context. There are 2 sections of JSON below one before the connectionStrings replacement and one when looking for configSections. You'll see that the entire document has changed, so when the system goes to look for configSections it's not there. I suspect that appSettings may only be working out of happenstance because it is processed before connectionStrings. I tried re-ordering the array of elements to look for in the document but they seem to keep getting ordered alphabetically when executed.
After though when it goes to look for configSections the xmlDomLookUpTable contains the following: