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:
...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!
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.
In the menu that shows up, you want to go to Debug Console - CMD
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.
for the connectionstring you have mentioned the password field is included in single quotes Password='password'... You need to remove the quotes around password
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:
...and entered it into
connectionStrings.config
:Can anyone see anything obvious I am doing wrong here? I am very new to the world of Azure!
Thanks,
John
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.
In the menu that shows up, you want to go to Debug Console - CMD
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!
for the connectionstring you have mentioned the password field is included in single quotes Password='password'... You need to remove the quotes around password
Thanks, everyone, for your help. Turns out I shouldn't include the quotes round the password...
is working on a reply...