The underlying provider failed on Open. while connecting to SQL Azure database through mvc application login

Dhananjay 0 Reputation points
2024-01-17T08:55:29.19+00:00

I've deployed my MVC application successfully on Azure..But while logging into application I get "The underlying provider failed on Open." I've implemented transient failure in code also. I connected my application locally to Azure SQL DB, its working fine, same on deployment its not working.

Azure SQL Database
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
62 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 4,695 Reputation points
    2024-02-06T04:19:28.3833333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    "The underlying provider failed on Open" is a common error message that occurs when there is an issue connecting to the database. This error can have various causes, and it's important to troubleshoot step by step to identify and resolve the issue. Here are some steps you can take to troubleshoot this problem:

    1. Check Azure SQL Database Connection String: Ensure that the connection string in your Azure-hosted application is correctly configured. Check the following:
      • Correct SQL Server name.
      • Correct database name.
      • Username and password are correct.
      • Ensure that the firewall settings on your Azure SQL Database allow connections from the application.
    2. Check Azure SQL Database Status: Make sure that your Azure SQL Database is up and running. You can check the Azure portal for the status of your database.
    3. Check Firewall Rules: Ensure that the firewall rules for your Azure SQL Database allow connections from the IP addresses or IP ranges where your application is hosted. You might need to add the IP addresses of the Azure data center where your application is deployed.
    4. SSL/TLS Encryption: Ensure that the connection string includes the necessary settings for SSL/TLS encryption if your Azure SQL Database requires it.
    5. Database Initialization: Check if your database initialization strategy is correct. If your database is not automatically created on startup, make sure it already exists in the Azure SQL Database.
    6. Azure Service Outages: Check the Azure Service Health Dashboard for any ongoing service outages or issues in the Azure region where your resources are located.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments