Closed JanKowalik closed 7 months ago
I'd recommend encoding it ahead-of-time and decoding it in the application. Probably as base-64, that's usually how tokens are encoded.
Does that work for you?
It's also worth trying taking out the space, so inputting just {"ABC":"mytoken&pass"}
instead of {"ABC": "mytoken&pass"}
Hi, thank you for your responses.
I only need this to work for development environment. When deployed, it executes in Azure and the values are provided via web service configuration (appsettings) it does not have any issue with it there. Therefore I am reluctant to add additional base64 decoding function just to make VSCode dev env happy.
I would put it in a .env
file and pass it that way but these are sensitive values that I don't want to store on local file system.
I understand that possibly encoding it as base64
is a better solution in the long run, so I might reconsider.
I will try to remove spaces and see if it works then.
Thanks again
This issue has been closed because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
I know the ticket has been closed now, but I just got back to it and tested with spaces removed. This doesn't help unfortunately.
Therefore either the bug is fixed in the extension's docker-run
task or the content has to be encoded with base 64.
Ok, I've reopened the issue.
@bwateratmsft Let me know if you need any more details from me. Thank you
Agreed, this is definitely an edge case that I don't believe we can prioritize and think the base64 encoding is the best option.
This might be an edge case but I will report it here anyway. I want to pass a JSON string to a dockerized app via an env variable defined in VSCode task. It works for normal text, but whenever it contains some token or password like value with characters considered special by win cmd.exe, then it crashes. Below is how I execute it with VSCode config files. This will crash regardless of the app code.
launch.json
tasks.json
The following
token
input will make it crash:{"ABC": "mytoken&pass"}
The error:
It runs successfully when the
token
input does not include&
Moreover from my tests it runs successfully when thetoken
is just:mytoken&pass
VSCode version: 1.84.0 Docker extension version: 1.27.0