Azure Website - Web API Swallowing Errors - azure

I have a asp.net web api application deployed as an azure web app. One of the endpoints occasionally throws an exception. Normally this isn't an issue for us. We have an ExceptionLogger attached to the api services. This has been in place for sometime and normally works fine.
Currently we see that a 500 response comes back from the server, but nothing is logged. I have tried setting GlobalConfiguration.Configuration.IncludeErrorDetailPolicy to IncludeErrorDetailPolicy.Always, but the response always comes back with no body content.
What else can I do to track the source of the problem?

If you have a consistent repro, then you can use remote debugging to attach to your web app and debug it (https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/).
Failing that, you can enable better diagnostic logs using the web app settings. Information on how to do so is here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/ under the section "Enabling diagnostic logs".
In your case you should have application logging enabled, and perhaps failed request tracing would be useful (FREB).
For even more tools you can use the Support Site Extension (http://azure.microsoft.com/blog/2014/12/01/new-updates-to-support-site-extension-for-azure-websites/) which would allow you to look at live event logs and HTTP traffic. For a deeper dive into debugging in Azure App Service see: https://channel9.msdn.com/Events/Ignite/2015/BRK4704.

Related

Log Trace.WriteLine in Azure

Our team has an ASP.NET Core Web Application which integrates Multisafepay payment provider (MSP). We use the .NET wrapper of MSP to communicate with the API of the payment provider. In some cases when we asking for the payment URL where the user can pay for his order we got an error code 9999 (unknown error). Mostly this happens after we restart our Web App in Azure or when it comes back from idle time.
I checked out the code of the MSP wrapper. It has some Trace.WriteLine statement in its code right where the error 9999 occurs. Is there any way to log the content of the trace in Azure?
I've tried almost everything. Modyfing the web.config, and adding trace listneres to it, turning on the Application Loggin and Log Stream in Azure, etc. but nothing worked.

View Requests in applications Insights

I have a web api project deployed on azure... I need to see all requests arrive to the APIs.
I am almost sure that before I could see the requests but now I do not see anything... The strange thing is that now applications insights look like switched off... Here what I see when I go on azure:
So, when I go in Analytics on Applications Isights on Azure and I try to do a query on the requests table no result is found.
App. Insights is enabled:
And the instrument key is the same on azure and on my vs project:
What could be happened? Thank you

Enable the AI using Application Insights Status Monitor but SQL Dependencies in Command property is not showing the generated SQL

I was hosted my ASP.NET web application into local IIS server, then enable the Application Insights by using Application Insights Status Monitor by following this link.
After configuration done, then I went to azure portal and open my application insights resource for seeing the dependency calls, requests, and exceptions everything coming nicely. The problem is that SQL Dependencies in Command property is not showing the generated SQL.
I can only see <server_name> | <database_name>, whereas in the other app I can see the whole query. See the below image for more information about my issue.
But After some time, I received the notification in status monitor like this below figure.
Can you please tell how to resolve the above issue as soon as possible?

How to resolve error 500 on Azure web app?

What I have:
VS2015U2
ASP.NET 5 MVC 6 website
Deployed to Azure Web App
The site works locally
When I deploy to Azure I get internal server error (500)
I'm unable to Attach a debugger since they messed up something with the latest versions (tried manually too https://azure.microsoft.com/en-us/blog/introduction-to-remote-debugging-on-azure-web-sites/)
I have app.UseDeveloperExceptionPage(); but I guess the site is failing during configuration so it doesn't display any other information.
So how to resolve this? I need to see the .net exception but I have no idea how to do that.
Try adding Application Insights to the app. You should see errors on startup of your application.
I would also take a look at your startup code to see if you are writing to disk anywhere during configuration or app.start. This might be the case if you are using AAD in any capacity.
You can also hit up the KUDU console by targetting https://sitename.scm.azurewebsites.net . You will be able to navigate in the debugging console to see the RAW logs from IIS. That might shed some light into the situation. See KUDU for more info.
I solved this problem like show below.HTTP 500 error interested about that is not allowed to access the server.Go to azure portal address and choose your database.Press"Set server firewall " and Allow Azure services and resources to access this server choose "Yes" save that page and refresh your service.Than you can see your data
Use the KUDU console at https://sitename.scm.azurewebsites.net
Go to web.config file and check if the process path is correct.
I used the Azure Log Stream to help figure out what was going on. As Karishma Tiwari - MSFT said, the issue ended up being my web.config file (which was built for .NET 3.5 and not 4.7)
Here's the tutorial to set up Log Streaming: https://blogs.msdn.microsoft.com/azureossds/2016/09/28/how-to-identifyreview-errors-on-php-applications-in-azure-web-apps-using-log-stream-service/
My particular app's solution was to update my Azure App Service to use .NET 3.5, in its Application Settings, like so:
For me it worked after I turned "Allow Azure services and resources to access this server
" to Yes
I got this error even though I had enabled Application Logging (Filesystem), Detailed error messages and Failed request tracing in App Service logs
This page isn’t working
mysite.azurewebsites.net is currently unable
to handle this request.
HTTP ERROR 500
However by navigating to Log stream and selecting Application Logs I could see a detailed error message:
I know this question has already been answered but here is a recent view of the Azure Portal where I found a solution to this problem

how to diagnose azure problems

I've recently starting experimenting with azure cloud hosting and my web app had about 10 minutes down time today.
I'm not sure why and I was wondering what tools I have available for determining the cause of the downtime.
You have application logs and site logs. Basically application logs are information produced by your web app code. You can use instrumentation to trace call and exceptions in your appliction. Site logs are information produced by the web server and you can see error messages and failed request tracing without instrumenting your code. You won't have relevant information now since by default all diagnostics are turned off but if it happens again you know where to look for.
Here's how to enable and visualize this information.
Enable diagnostics logging for web apps in Azure App Service
https://azure.microsoft.com/en-us/documentation/articles/web-sites-enable-diagnostic-log/

Resources