Problem on transform json file

Hi, i have a problem in the file transform json, for azure webapp, because, the automate added "{\ and " \n
Example:
i want:
“ConnectionStrings”: {
“AppSql”: "Data Source=xxxxxx.yyyyyyy.zzzzzz
and the transform give:
“ConnectionStrings”: "{“AppSql”: "Data Source=xxxxxx.yyyyyyy.zzzzzz.

How to avoid that \

I followed thefollowing method:

Can you help please ?

Hi!

Thanks for getting in touch! I tried your scenario locally and can confirm that we do re-format the JSON file by adding carriage return character.

Here are the steps I did
Deploy a package with json looks like this (no line break)
{“ConnectionStrings”: {“AppSql”: “Data Source=xxxxxx.yyyyyyy.zzzzzz”}}

And I’ve set up the variables as shown in the screenshots below

After the deployment, they both end up with the same json file with CRLF

To help me understand a bit better, could you clarify if the issue you’re hitting is about the reformatting? E.g. Does it cause the deployment to fail? Or you would like to compare them and the reformatting makes it hard to do so?

If that is not the case, would you be able to let me know how you setup the variable and what version of Octopus you are running?

These information would be great to continuing the investigation.

Looking forward to hear from you soon.

Regards
Eddy

Hi Eddy,
The action of deployment is ok, but the transform is not good
I want a file as:


and I have the file with a lot of

I have declared the variables as:

and the process config, we have activated json configuration variables and the target files is the good file.
When we reading le log of deployment the informations are good:

Extracted 214 files

08:29:10

Info
Performing JSON variable replacement on ‘D:\Octopus\Work\20180323072908-17\appsettings.json’

08:29:10

Verbose
Setting ‘ConnectionStrings’ = ‘{“AppSql”: “Data Source=XXXXXXXX.database.windows.net;Initial Catalog=YYYYYYYYYY;User ID=ZZZZZZ;Password=0123456”,“Blob”: “DefaultEndpointsProtocol=https;AccountName=storageXXXXX;AccountKey=veryveryverybigkey;BlobEndpoint=https://storageXXXXX.blob.core.windows.net/;QueueEndpoint=https://storageXXXXXX.queue.core.windows.net/;TableEndpoint=https://storageXXXX.table.core.windows.net/;FileEndpoint=https://storageXXXXX.file.core.windows.net/;”,“Datawarehouse”: “Persist Security Info=False;User ID=XXXYYY;Password=YYYYYXXXXXX;Initial Catalog=YYYYYYYY;Data sourceXXXXXXXX.database.windows.net”,}’

Currently we use the version of octopus deployment 3.3.6 .

Hi!

My apologies for the inconvenience caused by this problem. I managed to replicated this issue in version 3.3.6 locally.

There are two options I believe that might help

  • Use the colon syntax e.g. ConnectionStrings: AppSql as the variable in variable editor
  • Upgrade to the latest version of Octopus

You can find more information regarding this issue from here https://github.com/OctopusDeploy/Issues/issues/2453

Would you be able to try one of those options and let me know how you go?

Looking forward to hear from you soon.

Regards
Eddy

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.