Copied to clipboard

Flag this post as spam?

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


  • John Dawson 24 posts 135 karma points
    Oct 24, 2019 @ 08:59
    John Dawson
    0

    Azure: "A connection string is configured but Umbraco cannot connect to the database."

    Hi, I have published my Umbraco project to an Azure Web App and migrated the database to an Azure SQL DB. I am getting a connection error though and am guessing I have the Connection String set up incorrectly?

    I copied it from the Azure Portal:

    enter image description here

    ...and entered it into connectionStrings.config:

    <connectionStrings>
      <remove name="umbracoDbDSN" />
      <add name="umbracoDbDSN" connectionString="Server=tcp:voicesqlserver.database.windows.net,1433;Initial Catalog=voice_DBbackup;Persist Security Info=False;User ID=azureuser;Password='password';MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" providerName="System.Data.SqlClient" />
      <!-- Important: If you're upgrading Umbraco, do not clear the connection string / provider name during your web.config merge. -->
    </connectionStrings>
    

    Can anyone see anything obvious I am doing wrong here? I am very new to the world of Azure!

    Thanks,

    John

  • Chris Evans 137 posts 353 karma points c-trib
    Oct 25, 2019 @ 02:06
    Chris Evans
    1

    Which version of Umbraco are you using? By default, the connection string is normally in the web.config itself.

    If you've separated the connection strings into their own config file, you may need to check it's being included properly.

    If you're using Umbraco 7, you can also take a look at the latest log file in /App_Data/Logs

    On Azure you can access this by clicking on the app service, going to Advanced Tools and launching Kudu by clicking the Go button that appears.

    enter image description here

    In the menu that shows up, you want to go to Debug Console - CMD

    enter image description here

    Then, browse the folders to site/wwwroot/App_Data/Logs and find the latest UmbracoTraceLog file.

    This file will contain more detail about the exception and may explain why it's not able to connect (e.g. database server not found, login failed for user

    You can also test the login by trying to access the database using SQL Management Studio. Note that to do this, you'll need to open the firewall on the SQL Server inside the Azure portal to allow your IP address to access the DB.

    https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure#create-and-manage-ip-firewall-rules

    Hope this helps!

  • AddWeb Solution Pvt. Ltd 109 posts 360 karma points
    Oct 25, 2019 @ 05:30
    AddWeb Solution Pvt. Ltd
    100

    for the connectionstring you have mentioned the password field is included in single quotes Password='password'... You need to remove the quotes around passwordenter image description here

  • John Dawson 24 posts 135 karma points
    Oct 25, 2019 @ 08:17
    John Dawson
    0

    Thanks, everyone, for your help. Turns out I shouldn't include the quotes round the password...

Please Sign in or register to post replies

Write your reply to:

Draft