Answered by:
Azure Web App with API

Question
-
We have a Azure Web App that does an API call to a Sql Database in Azure. If we get a "Transport level error while connecting to SQL azure DB" where does that get logged?
Chris
- Moved by Micah McKittrickMicrosoft employee Tuesday, November 26, 2019 8:14 PM
Tuesday, November 26, 2019 7:43 PM
Answers
-
Apologies if the above post was not so clear. Yes, you can view the logs for the exception, as I mentioned in the above post/document- Enable diagnostics logging for web apps in Azure App Service –(Expanding more on the steps)- kindly enable the “Application logging” as verbose, reproduce the issue, we can fetch more details on the exception from the eventlog.xml file.
The Application logging: logs messages generated by your application code.
- To enable application logging for Windows apps in the Azure portal, navigate to your app and select App
Service logs.
- Select On for either Application Logging (Filesystem) or Application Logging (Blob), or both.
The Filesystem option is for temporary debugging purposes, and turns itself off in 12 hours (For your case, you may chose FileSystem). The Blob option is for long-term logging, and needs a blob storage container to write logs to.
If the issue still persists or the logs does not provide any useful info, please do share more details on your setup/framework/and concealed log (with no private info) details for better assistance.
Kindly let us know how it goes or you need more information we would be more than happy to assist you further.
- Marked as answer by IfEyeOnlyKnew Wednesday, November 27, 2019 5:16 PM
Wednesday, November 27, 2019 4:43 PMOwner - To enable application logging for Windows apps in the Azure portal, navigate to your app and select App
Service logs.
All replies
-
Since when are you facing this issue? Are you using a dynamic IP?
There could be many causes for this issue, so I would suggest you narrow down the issue:Typically, App Service roles can experience SQL connectivity failures for multiple reasons:
- SQL server not accessible (due to SQL down, firewall issues, etc)
- SQL server authentication failure
- Connectivity issues only when executing long queries due to TOR settings (NRP issue)
- SQL Always On configured incorrectly.
Take a look at the document Troubleshoot connection issues to Azure SQL Database for a step-step instructions.
You may checkout the documentation Enable diagnostics logging for web apps in Azure App Service for enabling the logs and analyze them to fetch more details on the issue.
Kindly let us know how the above goes for further investigation.
- Proposed as answer by AjayKumar-MSFTMicrosoft employee, Owner Wednesday, November 27, 2019 6:38 AM
Wednesday, November 27, 2019 6:38 AMOwner -
Thanks for the information, but I am looking for an answer to my question? Does this error get logged? Where? How?
Chris
Wednesday, November 27, 2019 3:29 PM -
Apologies if the above post was not so clear. Yes, you can view the logs for the exception, as I mentioned in the above post/document- Enable diagnostics logging for web apps in Azure App Service –(Expanding more on the steps)- kindly enable the “Application logging” as verbose, reproduce the issue, we can fetch more details on the exception from the eventlog.xml file.
The Application logging: logs messages generated by your application code.
- To enable application logging for Windows apps in the Azure portal, navigate to your app and select App
Service logs.
- Select On for either Application Logging (Filesystem) or Application Logging (Blob), or both.
The Filesystem option is for temporary debugging purposes, and turns itself off in 12 hours (For your case, you may chose FileSystem). The Blob option is for long-term logging, and needs a blob storage container to write logs to.
If the issue still persists or the logs does not provide any useful info, please do share more details on your setup/framework/and concealed log (with no private info) details for better assistance.
Kindly let us know how it goes or you need more information we would be more than happy to assist you further.
- Marked as answer by IfEyeOnlyKnew Wednesday, November 27, 2019 5:16 PM
Wednesday, November 27, 2019 4:43 PMOwner - To enable application logging for Windows apps in the Azure portal, navigate to your app and select App
Service logs.
-
Will give this a try.
Chris
Wednesday, November 27, 2019 5:17 PM -
Will give this a try.
Sure, please let us know. Thanks for the update, Chris.
Chris
Wednesday, November 27, 2019 6:30 PMOwner