Copied to clipboard

Flag this post as spam?

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


  • Elliott Brown 40 posts 210 karma points
    Aug 25, 2022 @ 10:16
    Elliott Brown
    0

    Deploying to Azure, db connection issue

    UMB10

    Hi, I'm hoping someone can help.

    I have successfully set up an Azure installation including db.

    On innitial local build, Umb gives me the chance to 'change db', which I select and then point at my Azure Sql db instance. Setup works and I'm redirected to the backoffice.

    Publishing to Azure directly from VS using the 'publish' option, everythhing is successful apart from I'm now faced with the 'install Umbraco' screen again.

    I no longer have the option the option to change the db and it appears to set to sqlLite (the default I believe). I then get an error saying my db credentials are invalid (which makes sense if it's not pointed at my Azure Sql db)

    enter image description here

    What have I missed?

    Thanks in advance for your help!

    Elliott

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 25, 2022 @ 10:32
    Jeavon Leopold
    0

    Hi Elliott,

    Most commonly with this issue it is that the Azure SQL Server isn't set to "Allow Azure services and resources to access this server" within the "Networking" settings on the portal.

    Jeavon

  • Elliott Brown 40 posts 210 karma points
    Aug 25, 2022 @ 11:28
    Elliott Brown
    0

    Thanks Jeavon,

    It is already checked. I wish that was the solution! :)

    I've added a picture to the original post. As you can see, It's decided the db is SqLite and I don't have the option to select an alternative. Could it be that it's not pointed at the connection string?! Is there there a difference between development and deployment connection string settings?

    Thanks!

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 26, 2022 @ 08:46
    Jeavon Leopold
    100

    I would use Kudu to check appsettings.json and appsettings.production.json to verify that both umbracoDbDSN & umbracoDbDSN_ProviderName are present and correct.

    The fact that the "Change Database" button is missing suggests it's finding something

  • Elliott Brown 40 posts 210 karma points
    Sep 03, 2022 @ 18:45
    Elliott Brown
    1

    Thanks Jeavon - I don't think this question will turn out to be that useful to anyone else but you were right. It was do to with the connection - publishing to Azure from VS disregards the connection string information in favour of the publishing profile. This is great if the publishing profile is up to date! Anyway, issue solved by refreshing the publishing profile! Thanks for you help!

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 05, 2022 @ 18:34
    Jeavon Leopold
    0

    Good to hear you solved it!

  • Kieron McIntyre 5 posts 27 karma points
    Sep 22, 2022 @ 16:38
    Kieron McIntyre
    0

    Hi guys,

    I have a similar issue that is driving me nuts.

    • Umbraco v10 on Azure;
    • Connection string set in the app service including the provider;
    • I can extract the connection string into logging so I know it's present
    • I can query the database with a hard-coded, old skool SqlConnection/Data reader from Startup.cs, so I know the connection string is correct

    However, when I run the app I keep getting the "Install Umbraco" screen, exactly as Elliot has posted, with SQLite refernced et al.

    The only thing that is different is that the connection string is referencing to a Azure failover group and the authentication is AD integrated, so there are no credentials.

    Would this be it? Does Umbraco not support this type of authentication?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 27, 2022 @ 12:02
    Jeavon Leopold
    1

    The only thing that's come to mind is to check you have the umbracoDbDSN_ProviderName setting set to "Microsoft.Data.SqlClient" without this Azure will default to using "System.Data.SqlClient"

  • Ben Duguid 12 posts 85 karma points
    Oct 13, 2022 @ 12:10
    Ben Duguid
    0

    Couple of points I've noticed:

    The button to change database only enables once you've completed the other fields on that page. It also won't enable if there's already a SqlLite connection string in the appsettings.json or appsettings.Production.json files.

    I'm currently having an issue whereby I supply my database connection details, the call to PostValidateDatabaseConnection succeeds (and this is clearly doing something, because if I enter the wrong details I see a logged failed dependency call to Azure SQL), and then the install quickly fails during the "DatabaseInstall" step, with the error:

    Umbraco.Cms.Core.Install.InstallException: The database failed to install. ERROR: Database configuration is invalid. Please check that the entered database exists and that the provided username and password has write access to the database.

    The correct values appear to be added to the appsettings.json, and running the installer from a local machine to the Azure SQL database succeeds.

Please Sign in or register to post replies

Write your reply to:

Draft