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).
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".
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.
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.
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.
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.
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.
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...
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).
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?
Hi Simran
Did you open 1433 port for all applications?
Alex
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
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
Thanks for sharing the solution, really tricky one.
Have a great evening, Simran
/Alex
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.
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.
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.
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.
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.
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
is working on a reply...