Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ben 10 posts 120 karma points
    Aug 24, 2024 @ 20:09
    Ben
    0

    Kestrel Connection String/umbracoDbDSN as environment variable (Linux/Ubuntu)

    I don't want to keep connection strings in prod in files (appsettings.json), I'd prefer them to be stored as environment vars for kestrel, just makes CI/CD easier.

    Searching through the forum, documentation and around online didn't really help me all that much, but a little guess and test revealed the answer.

    This is how I did it:

    You'll need to create a systemd service if you haven't already.

    Inside of the service file, you can define the following, and Umbraco will pick it up:

    Environment=ConnectionStrings__umbracoDbDSN="<your connection string>"
    Environment=ConnectionStrings__umbracoDbDSN_ProviderName: "Microsoft.Data.SqlClient"
    
Please Sign in or register to post replies

Write your reply to:

Draft