Reputation: 1
My .NET site is hosted on azure and working fine but suddenly it get stopper and below error occurred. Please confirm below: 1.Is the issue from azure side 2. or from SQL side 3. how I can resolve this.
Stack Trace:
[Win32Exception (0x80004005): Access is denied]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
HomePage.btn_Search_Click(Object sender, EventArgs e) +1526
<Page_Load>d__2.MoveNext() +745
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Web.Util.SynchronizationHelper.SafeWrapCallback(Action action) +114
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
System.Web.Util.WithinCancellableCallbackTaskAwaiter.GetResult() +33
System.Web.UI.<LoadRecursiveAsync>d__246.MoveNext() +492
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
System.Web.Util.WithinCancellableCallbackTaskAwaiter.GetResult() +33
System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +6951
Upvotes: 0
Views: 243
Reputation: 181
The errors reported in the question are not related to Azure Web App itself. It could be or could not be related to the DB itself. The error is mainly for connectivity failure i.e., the application code is not able to establish connection with DB.
The first step here would be isolate the issue:
1. Is it related to DB itself? - Depending on where the DB is hosted and the type of DB (Microsoft SQL, mySql etc.), verify its status and try connecting to it using any of the tools available. For example, in the case of Microsoft Azure/SQL Server, you might use sqlcmd tool or SQL Server Management Studio can be used for this purpose.
2. Is the webApps trying to connect to the correct SQL DB? - Once you have verified that the DB is up and running, the next step would be to ensure that you web application is connecting to correct DB. The connection string used to specify this db in application will have to be checked to ensure that there are no errors in server/db/userId/Password etc.
3. Is it related to connectivity/permission - If everything is verified to be fine based on the points above, the next step would be to ensure that the web app is able to reach out to db (there are no network/permission issues). Looking at the logs on SQL Server itself could provide some insights. For example, for Microsoft SQL Server (hosted on Windows Server), in EventViewer\Application logs, you would see event 18456 if there is a login issue - which would mean that the connectivity is fine, but the authentication method used is failing. In this case, you will have to assign correct permission to the identity/userid which is being used by webApp for connecting to the SQL Server.
In case the issue is related to network itself, i.e., the requests are not even reaching out to DB, depending on where the SQL Server is hosted you can perform the following:
Check the SQL Server error log for more information about the error.
Upvotes: 1