Copied to clipboard

Flag this post as spam?

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


  • Simran Singh 4 posts 94 karma points
    Mar 15, 2018 @ 16:58
    Simran Singh
    0

    Umbraco first-time install - Cannot connect to Azure SQL database

    Hi guys,

    In the past I already had some experience working on Umbraco websites but the setup was mostly taken care off already by other people. Now I'm setting up a new website for a client and I'm running in issues when running the installation wizard which configures the underlying database.

    I've created a new empty .NET web application using VS2017, installed the UmbracoCms Nuget package, build, launched the project and arrived at the install wizard. No changes were made in the web.config.

    In the mean while in Azure I created a new SQL server and database and added my client IP in a new firewall rule. Afterwards I connected to the SQL database using SQL Management Studio. No problem here at all, I can see the database and execute SQL statements so firewall config cannot be the issue. Also the SQL user I'm trying is a db admin so it should have the correct permissions.

    Now in the Umbraco install wizard I have arrived at the "Configure your database" step and here my head ache starts. I tried the options "Custom connection string" and "MS SQL Azure". For the first option (custom) I have copied the connection string directly from Azure, replaced the user name and password => no luck. The second option does neither work (see screenshot). enter image description here

    I have been careful not to include any additional and unneeded spaces or other characters but no luck. In the server text field I tried with and without the port number (1433). I have read about some caching of the connection string as well so as a last resort I deleted the entire VS project and started over and again the message "Could not connect to database".

    Anyone got any ideas?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 15, 2018 @ 19:40
    Alex Skrypnyk
    0

    Hi Simran

    Did you open 1433 port for all applications?

    Alex

  • Simran Singh 4 posts 94 karma points
    Mar 15, 2018 @ 19:47
    Simran Singh
    0

    Hi Alex,

    Yes, port 1433 is open. I'm using Azure SQL databases for custom projects as well and I didn't experience the problem there.

    Simran

  • Simran Singh 4 posts 94 karma points
    Mar 15, 2018 @ 19:53
    Simran Singh
    100

    Hi guys,

    I seem to have found the solution to my problem and it was not straightforward at all.

    I was using a strong password generated by a password generator found online. Since I have changed the password, I might as well post it here in this thread: raYEH;,4sjTR.%!#

    Running out of options I tried changing the SQL user's password to something "simpler". And to my big surprise when I tried the same screen as shown in the screenshot in the description: it worked!

    I have never read about password character limitations in a connection string (please correct me if I'm wrong) and if not this can be considered as a nasty bug.

    Best regards,

    Simran

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 15, 2018 @ 19:58
    Alex Skrypnyk
    0

    Thanks for sharing the solution, really tricky one.

    Have a great evening, Simran

    /Alex

  • Chau Nguyen 1 post 71 karma points
    Jan 02, 2020 @ 19:48
    Chau Nguyen
    0

    I have same issue for the configure Azure database. I tried your suggestion but it doesn't work for me. I also open port 1433. Do you have any other solution? Please help, Thanks.

  • John Bergman 483 posts 1132 karma points
    Jan 04, 2020 @ 12:57
    John Bergman
    0

    Is it possible your SQL user had the "change password on first logon" set? If so, the way I usually handle that is connect via Management studio first to change the password and then use the changed password.

  • Runar Løseth 11 posts 92 karma points
    Jan 08, 2020 @ 11:18
    Runar Løseth
    0

    Also make sure your IP is cleared in your database's firewall settings, this was causing the same error to pop up for us when installing from a local machine.

    We were able to install with a password complexity matching the one reported by Simran Singh on Mar 15 2018 using Umbraco 8.4.

  • Harikrishna Parmar 43 posts 262 karma points c-trib
    Apr 27, 2022 @ 17:36
    Harikrishna Parmar
    0

    Hello, I just want to share that, I got the same error and fixed it to Allow Azure services and resources to access this server.

    enter image description here

  • Scott Meikle 28 posts 228 karma points
    Jun 02, 2022 @ 11:47
    Scott Meikle
    0

    Hi folks,

    I hit the same issue recently when installing Umbraco 9.5 and fixed it just by changing the database type to "Use custom connection string" and then just pasted in the credentials there, e.g.

    server=my.azure.server;database=MyDatabase;user id=my_user;password='My Password'
    

    Obviously just replace the above content with your own credentials filled in instead.

    My real password had some special characters in it like in Simran's issue above so that might have been my problem, too. Anyway, the fix worked for me...

    HTH,

    Scott

Please Sign in or register to post replies

Write your reply to:

Draft