how to diagnose azure problems - azure

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/

Related

How to view errors for WebApp in Azure portal and what configuration it is required

I am working on the ASP.Net MVC 4.8 application. It does have Logs file log4net and it was deployed in on-premises. Now it has been migrated to Azure. Now I am trying to find out some errors and other logs information however I am not able to find where to go and look for the logfile. I have two interest, 1 check the error messages and any log information.
If I need to make some changes what would be the easiest and straightforward way to capture logs and view them in Azure portal. As you can see in the picture below unter Monitoring there are many ways are given to see the logs but I am not sure where to go.
The app service will create an application insights of the same name.
This application Insights will contain all the logs regarding the web app along with performance data and other telemetry data too.
You can view logs live under live metrics tab in application insights of the same name as web app .
Here I have deployed a simple mvc app which logs using Ilogger (typical boilerplate app which visual studio provides ) . IT will log once I refresh the page.
Refer these MS DOCS on application insights

Will enabling application insights interrupt my azure function?

I have a Node.js functions app running in azure and it is processing thousands of requests every minute, I would like to enable Application Insights using the Azure Portal in order to diagnose an issue but I fear this may interrupt the function while it configures itself.
Is this a valid concern?
All the documentation I have found regarding Application Insights does not mention the impact on any running applications.
Adding AI integration is only a matter of adding a key to app settings, but any edits to app settings require a function app to restart, so yes it will affect your function.
I did some tests, and I made a request to it after enabling Application Insights. It will indeed be affected for a few seconds because it will change the app settings and then restart the Azure function.

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

Azure Website - Web API Swallowing Errors

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.

What is the difference between Application vs Site Diagnostics on Azure Websites?

what's the difference between these two, please?
NOTE: I'm not talking about the storage medium (I know the diff between FS/TS/BS, etc).
site diagnostics is your typical web server logging (e.g., failed request tracing, http errors, etc...)
application diagnostics are the one's produced by the web app itself, i.e, Trace info, etc...

Resources