Closed ghost closed 7 years ago
@smd11 , thanks for reporting the issue. This issue was fixed in 3.2.* version of the task. Can you please share the debug logs (by setting system.debug=true) and the version of the task ?
@vincentdass the task that I'm working with is IIS WebApp Deploy(Preview) that is related to the new Deployment Groups feature. The logs shoes that version of the task is 0.0.14. Here is the debug log from running the task: ` 5_IIS Web App Deploy (Preview).zip
`
and here is the output web.config file: Web.config.zip
Thanks
@smd11 , @samidieb . Sorry for the wrong info. The issue is resolved and the fix will be available in a week or two with 0.0.15 task version.
Deployment in currently in progress and the fix will be available in a week or two.
@vincentdass I still have this problem on some .config file. Currently I'm running Umbraco CMS with the uSync add-on and it creates a lots of config files. The IIS Web App Deploy(Preview) task is trying to substitute variables in all of this files.
I'm running version 0.0.21 of the task, the uSync files is stored under a subfolder uSync\data in the root.
I can send over log files in private.
@k-ljung , Please share the debug logs (set variable system.debug=true and rerun the release) to RM_Customer_Queries@Microsoft.com
?
@vincentdass, done
hi @vincentdass
I'm experiencing a similar issue Azure App Service Deploy 3.3.24
. It says XML variable substitution applied successfully
but has weird behavior.
2017-11-08T05:27:48.9925301Z ##[section]Starting: Deploy My App
2017-11-08T05:27:49.0237840Z ==============================================================================
2017-11-08T05:27:49.0237840Z Task : Azure App Service Deploy
2017-11-08T05:27:49.0237840Z Description : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs
2017-11-08T05:27:49.0237840Z Version : 3.3.24
2017-11-08T05:27:49.0237840Z Author : Microsoft Corporation
2017-11-08T05:27:49.0237840Z Help : [More Information](https://aka.ms/azurermwebdeployreadme)
2017-11-08T05:27:49.0237840Z ==============================================================================
2017-11-08T05:27:52.1175930Z Got connection details for Azure App Service:'is-ff-myapp'
2017-11-08T05:27:55.8832924Z XML variable substitution applied successfully.
Before XML variable substitution
my Web.config
file looks like this
<!--add key="Chargify.Something.Values" value="499101,536997,594079,1005146" />
<add key="Chargify.SomethingElse.PublicExcludes" value="1005146" />
<add key="Chargify.SomethingSomething.ID" value="3900550" />
<add key="Chargify.Base.Url" value="https://investsmart.chargify.com" />-->
After XML variable substitution
my Web.config
file looks like this
<add key="Chargify.Base.Url" value="https://mycompany.chargify.com" />-->
To reproduce this, open a web.config (or any XML ) file, select more than 1 line then use Visual Studio's multi line comment (CTRL+K, CTRL+C) shortcut.
@frankfuu , thanks for reaching out. We have an active thread on this issue and planned for hot-fix. Please follow the above thread for further updates.
Hi @vincentdass, thanks for the quick response
Hi @vincentdass ,
I have just started getting the same issue. I have a setting in web.config which is using ampersand.
<add key="DatabaseConnectionString" value="MY_DB_DATA&ssl=true" />
In the release definition i have a variable DatabaseConnectionString with a secret value. The variable's value stores plain connection string ( without escaping the ampersand ) i.e.
MY_DB_DATA&ssl=true
Last time i did a release ( around a month ago ) it was working - it replaced the web.config file with escaped ampersand so this:
MY_DB_DATA&ssl=true
became this:
MY_DB_DATA&ssl=true
Today it does not work that way - it replaces the whole text without escaping it, and therefor making web.config file invalid xml. Is it indended ? I think it shouldn't work like that - i'm using this variable for other tasks too where it can't be escaped.
I would like to know which behaviours is the expected one.
Task details below:
2018-04-19T11:32:31.5328700Z Task : Azure App Service Deploy 2018-04-19T11:32:31.5329990Z Description : Update Azure WebApp Services On Windows, Web App On Linux with built-in images or docker containers, ASP.NET, .NET Core, PHP, Python or Node based Web applications, Function Apps, Mobile Apps, Api applications, Web Jobs using Web Deploy / Kudu REST APIs 2018-04-19T11:32:31.5332866Z Version : 3.3.46 2018-04-19T11:32:31.5334390Z Author : Microsoft Corporation 2018-04-19T11:32:31.5336355Z Help : More Information 2018-04-19T11:32:31.5337408Z
@MichalKoscielniak , ideally there should be no alteration made to the variable value set by the user.
This was a bug and we fixed it. This caused the regression in your case.
Please change your variable value to required value (MY_DB_DATA&ssl=true
)
@MichalKoscielniak , ideally there should be no alteration made to the variable value set by the user. This was a bug and we fixed it. This caused the regression in your case. Please change your variable value to required value (
MY_DB_DATA&ssl=true
)
I think this is a wrong advice, because it moves the responsibility of transforming the data into variable container. For example, what if the content of the variable is going to be used both in JSON and XML? The content should be correct and should be adjusted/escaped based on the target file type. This is something that is implicit when working with XMLs.
I agree with @Sarafian , you should preferably have the correct value (with '&' not '&') in your variable, then it should be escaped correctly by the xml variable substitution.
If you have to do the escape in the variable itself, you have to have one variable for xml and another variable for json and other config files that don't understand that '&' == '&'
XML variable substitution - handling special characters problem
When I use IIS Web App Deploy (Deployment Groups) and XML variable substitution to modify the web.config file I see that the string in the output file is different from the input. In my case I have this connectionstring that I specify under Variables when creating a new Release definition. The connectionstring should be updated in the web.config in the deployed web app:
Data Source=xxxx-xxxxx;Initial Catalog=xxxxxxxx;User Id=xxxxxxUser; password='E~FU:5&?77WY3wRU#:'
but this is changed to
Data Source=xxxx-xxxxx;Initial Catalog=xxxxxxxx;User Id=xxxxxxUser; password='E~FU:5&?77WY3wRU#:'
So it seams like this feature is not able to handle special characters?
also when I test the same string that you have inside vsts-tasks/Tasks/Common/webdeployment-common/Tests/L1XmlVarSub.ts
This string: Url=https://primary;Database=db1;ApiKey=11111111-1111-1111-1111-111111111111;Failover = {Url:'https://secondary', ApiKey:'11111111-1111-1111-1111-111111111111'}
is changed to:
Url=https://primary;Database=db1;ApiKey=11111111-1111-1111-1111-111111111111;Failover = {Url:'https://secondary', ApiKey:'11111111-1111-1111-1111-111111111111'}