I made a thing!

I needed to translate some JSON configuration (like the appsettings.json file used by ASP.NET Core) into equivalent environment variables (so that they could be set in a Dockerfile). Rather than try and figure it out, I created a simple web tool to do the conversion for me.

Website screenshot

  1. Paste your JSON into the first text field
  2. Select the formatting options
    1. Dockerfile-style or Yaml (suitable for docker-compose.yml or azure-pipelines.yml)
    2. Whether to include entries with a key but no value
    3. Use colons or underscores as separators
  3. Press Convert
  4. Review and/or copy the text that appears in the second text field.

You can find it at https://jsontoenvironmentconverter.azurewebsites.net/, and the source code is at https://github.com/flcdrg/JsonToEnvironmentConverter