✅ How to connect to Cloud database from local?
# help-with-umbraco
c
Hi there - I have a site where I need to "[connect my] local install to your cloud database by changing the ConnectionString in [...] appsettings.json". I have no idea what to write where for this to work - any pointers? The docs mention that I can change the "ConnectionStrings" settings, but that one doesn't exist in neither of the appsettings.*.json files...
m
The Umbraco docs should have all the info you need to for this. You will have to add your local IP to the firewall and then just pluig in your connectio nstring into the appsettings.json file https://docs.umbraco.com/umbraco-cloud/databases/cloud-database
c
Well, turns out "just plug in your connection string" leaves a lot of room for failure on my part. I don't know what it looks like (I get all the login info etc. in the portal, yes) ...
s
You're right, none of this is showing you what to put in appSettings.json and where.
Copy code
"ConnectionStrings": {
    "umbracoDbDSN": "Data Source=(localdb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Umbraco.mdf;Integrated Security=True",
    "umbracoDbDSN_ProviderName": "Microsoft.Data.SqlClient"
  }
Replace the
umbracoDbDSN
bit with info from the portal. I think it's still not quite clear how to build the connection string though from the portal info. https://cdn.discordapp.com/attachments/1212384681660514314/1212387858594140170/image.png?ex=65f1a72e&is=65df322e&hm=84c85e3233991411524b401b76bcb1b0d3d20d253bfeb15e7e70b608d4407875&
c
Thanks Sebastiaan 🙌 - I also couldn't see where the key went in the JSON - I do now 👍
s
Hence the screenshot (since I also can never remember 😅)
c
I'll try to remind myself to write a blogpost and/or update the docs 😁
m
sorry i did not go thouythe entire doc to check for appsettings, i only made sure it talked sbout the firewall and whete to get your connection string from. Thanks for picking up my slack @Sebastiaan
c
5 Views