How to publish a blazor website with sql sever that is giving the error HTTP Error 500.30 - ASP.NET Core app failed to start

Aidan Waterford 20 Reputation points
2024-11-18T11:43:25.1633333+00:00

hi,

im trying to publish my blazor web app on azure however it fives me the error HTTP Error 500.30 - ASP.NET Core app failed to start. when i try to debug it and go into the diagnose page of the websever i get this error Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open server "aidandwaterfordgmail.onmicrosoft.com" requested by the login. The login failed. how do i fix it?

ps i have changed fire wall setting as the connection string works on my local matchine

Azure SQL Database
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,605 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,297 questions
{count} votes

Accepted answer
  1. Shree Hima Bindu Maganti 895 Reputation points Microsoft Vendor
    2024-11-19T08:28:32.26+00:00

    Hi @Aidan Waterford,
    Welcome to the Microsoft Q&A Platform!
    The error indicates a problem with your Blazor app's database connection. Specifically, the SQL Server cannot authenticate the login request for the user account specified in the connection string when the app is running on Azure.
    Check the Connection String

    Server=tcp:<your-server-name>.database.windows.net,1433;
    Initial Catalog=<your-database-name>;
    Persist Security Info=False;
    User ID=<your-username>;
    Password=<your-password>;
    MultipleActiveResultSets=False;
    Encrypt=True;
    TrustServerCertificate=False;
    Connection Timeout=30;
    

    Incorrect Authentication Method: The connection string is using an Azure AD login, but the SQL Server may not be configured to accept Azure AD authentication.

    Firewall Misconfiguration: Although the firewall is set, ensure that "Allow Azure services and resources to access this server" is enabled in the Azure SQL Server settings.

    Mismatched Connection String: The connection string that works locally may not be valid for Azure if it uses Integrated Security or local credentials.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.