How to Enable Azure Diagnostics in Cloud Services - azure

I want to enable azure diagnostics for my azure cloud service but I'm a little bit confused.
I read the article : https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-diagnostics. I found also that I can enable azure diagnostics in the cloud service properties page by checking "Enable Diagnostics" in the Configuration tab of the cloud service. Also I can go more advanced by clicking the Configure button that shows up when you enable diagnostics.
The cause of my confusion is why in the article says you need to download the WadConfig.xsd file and configure everything and then upload an xml file while you can do the same thing (not sure the same thing) in the cloud service properties configuration?

It seems that Azure SDK 2.5 and later allow us to enable diagnostics and configure diagnostics configuration in UI by right-clicking on the Role and selecting Properties. But developers using Azure SDK 2.4 and previous versions can not manage diagnostic configuration in Visual Studio .
For detailed information, please read this blog.

Related

how to port app insights configuration from azure to config file

We enabled application insights via azure portal some time ago. Everything worked great and we want to log bit extra custom information. So we will have to include appInsight SDK and create TelemetryClient and RequestTelemetry in our code now.
Ideally, we would like to enable the exact same setting as we enabled in azure portal (e.g. enable profiling, recommended collection level, sql command and disable Snapshot debugger).
However, when I look at the appinsight config file, I realised that this file is way more complicated than what azure portal offers.
Is there a way to convert what we enabled on azure portal to the config file?
Or if I delete this config file (just add the custom field in our c# RequestTelemetry instance), will appInsights use settings from azure portal automatically?
If you are using Asp.Net Application, installing SDK by default will generate the full ApplicationInsights.Config file for you, which would do same level of monitoring as Recommended level.
https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net
And follow this to get full SQL Text:
https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-dependencies#advanced-sql-tracking-to-get-full-sql-query
If you are using Asp.Net Core Application, installing SDK by default will automatically configure everything in code (there is no ai.config in asp.net core apps).
https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core
You dont need to do anything additional to get full SQL Text in Asp.Net Core apps.
SnapShotCollector is not enabled by default, so you dont need to do anything to disable it.
Profiler: https://learn.microsoft.com/en-us/azure/azure-monitor/app/profiler#enable-profiler-manually-or-with-azure-resource-manager
For application insights, maybe you know that there is 2 ways to apply Application Insights to your .NET web applications(For details, please refer to here).
Build time: add application insights sdk
Run time: via azure portal without adding sdk to your project.
And the screenshot below shows the difference of them(you can ignore the Note section about build-time and run-time in this article, this gives users confusion and an issue is tracking that):
And for your issues, I suggest you'd better use both of them: adding sdk and also enable/disable profiler / snapshot debugger / sql command via azure portal.
I did some tracing about sql command before, without enable from azure portal, you cannot get a details sql command info from application insights with just adding sdk. Not make some changes via config file.
And there're also described in docs like below, take profiler for example:
In the profiler doc, it says: Follow these steps even if you've included the App Insights SDK in your application at build time.
And also, it would be more difficult to change appinsight config file to meet your need, there is even no official doc about these for apply profiler / sql command via config file.
I just found a blog about how to configure snapshot debugger via appinsight config file, you can take a look and try it at your side.

How would one login to Azure cloud classic service instance?

I have setup a azure cloud classic. Where I have two instances running one is web role and orleans silos. I want to enable trace and I need a means to login into the box and see the logs. Azure portal is not providing the logs I needed. I am following the following link https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-role-enable-remote-desktop but, in the first step, is to click on the cloud service and click configure but I do not see configure option anywhere. I see only 'Pin, swap and delete'. But I did see an option when click on the cloud class, called configuration. In that configuration, there is nothing for remote desk top.
I do have an option for remote desk top, but when I click that I get an message "This deployment is using RemoteAccess and/or RemoteForwarder modules. We recommend using the RDP extension instead. You can enable this mode by removing the modules from your .csdef and .cscfg and then saving your RDP configuration here."
so my basic question, how what is proper way to remote to that box provided I am getting above mentioned message?
According to your description, you are using Azure new portal to configure Remote Desktop. For a simple way, you could log into Azure classic portal to leverage Remote Desktop Extension approach for you to enable Remote Desktop even after your application is deployed.
Note: For more details, you could follow the section about configuring Remote Desktop from the Azure classic portal in this doc.
so my basic question, how what is proper way to remote to that box provided I am getting above mentioned message?
You could follow this tutorial about configuring Remote Desktop in the service definition file.

No data on Application Insights

I have Application Insights SKD on a ASP.NET application, but i can't see data on Azure Portal, I have followed the official documentation for troubleshoot and the connectivity with dc.services.visualstudio.com seems to be fine but i can't connect to f5.services.visualstudio.com, but f5.services.visualstudio.com seems not used anymore, I can't access it inside and outside of my network.
The account have access to Performance Logs too, and I uninstalled the SCOM Monitoring Agent to prevent problems, but still no data!
Check that assemblies are included in your project
Check you have last SDK version of Application Insights installed
Check ApplicationInsights.config file exists in the root of application and instrumentation key is presented
If you resolve InstrumentationKey from web.config or from another place, debug your application and ensure the InstrumentationKey is really resolved
Check your telemetries are collecting using the Visual Studio Diagnostics Hub (developer mode must be set to TRUE - by default)
Try to send more telemetries or change the flush interval to 0
First place where you can check your telemetries is Azure Portal - Diagnostic Search blade
Try to check quotas on Azure Portal

Azure Cloud Configure Tab is disable in Cloud Services

I am trying to enable the verbose monitoring for the cloud services. After reading documentation and lots of blog posts this can be done in the configure tab of the cloud service.
But the configure tab is disabled for that cloud service. Can to enable the verbose monitoring for that cloud service. I am struck at this.
I am running out of ideas. will appreciate can some one shed some light and help me on this.
In Visual Studio,
Locate your cloud project.
Locate the role (under 'Roles' folder) and open it (double click it).
Under the 'Diagnostics' section, make sure 'Enable Diagnostics' is clicked.
In addition, you may prefer to not use the default option, and to instead specify what storage account is used to store diagnostics info. If so, under "Specify the storage account credentials for the Diagnostics results:", click the [...] box, and click 'Your subscription' radio button, and then you'll have a drop down of storage accounts to select from.
Republish your cloud service.
I did this and it fixed the problem where the monitoring Minimal / Verbose option was grayed out and not available, as well as the Diagnostics Connection Strings under that having been empty.

Diagnostics to find out why Azure Web Role doesn't start

I am trying to deploy a large web site to Azure as a Web Role. However, Azure on the Instances tab of the Azure dashboard, it tells me it suffers an error during start up, causing it to restart over and over again.
Where can I find log files that will tell me what specifically is going wrong? The manage.windowsazure.com site doesn't seem to have any.
First, debug on your dev machine. Make sure you deployed the right .cscfg file, you don't have any broken connection strings, you're referencing the right version of the DLLs (the same as Azure's VMs) or are copying newer versions to Azure. If those fail, read this topic on WindowsAzure.com and the topics in this node on MSDN. The Hello World code sample also has a basic demonstration of diagnostics that should be helpful.
The basics of diagnostics in Windows Azure:
Must be manually enabled for each role by importing the Diagnostics module in your ServiceDefinition.csdef file
A storage location needs to be configured for the resulting logs in your ServiceConfiguration.cscfg file, such as the storage emulator, or a Windows Azure Storage account. Depending on the types of logs, they are stored in either blobs or tables.
You can either configure diagnostics collection programmatically or with a file that is read when your role starts and can be updated on-the-fly
You can set up and control how often diagnostics data is downloaded to your storage account (important because transactions/transfer/storage costs money), performance counters, or other metrics you need
There are a series of 4 blog posts at http://blogs.msdn.com/b/kwill/archive/2013/08/09/windows-azure-paas-compute-diagnostics-data.aspx which will walk you through step by step how to troubleshoot a role startup failure including log file locations, etc.

Resources