How to use IntelliTrace in Azure Development Fabric? - azure

When I create a new Azure solution (with a web role and a worker role), add a line of code to the Default.aspx.cs file, put a breakpoint there, and launch debugging in the Development Fabric, when the breakpoint is hit and I look at the Intellitrace tab, I am confronted with the following error message:
Intellitrace is not collecting data for this debugging session. The project type may not be supported or the process you are debugging may have been either attached to or launched with IntelliTrace disabled. Restarting the debugging session within Visual Studio may solve this. Please note that IntelliTrace is not supported when attaching to a process that is already running. If you have selected a custom location for InteliTrace [sic] recordings, please make sure it is writable by the process being debugged.
The problem also occurs with other Azure solutions that I previously created. When I create a standard ASP .Net web application, I am able to use IntelliTrace without difficulty. I have tried this both without selecting a custom location for IntelliTrace recordings and using the same location that I used for a standard ASP .Net web application. I tried restarting the computer too. I also reinstalled the Windows Azure SDK. Because of concern that IntelliTrace might not work when SQL Server Debugging is enabled, I made sure that SQL Server Debugging was disabled on the worker role (the only project that had an option for this in the Debug tag of the project settings).
The closest resource on this question is on the MSDN forums. The answer is unclear. It states, "For locally, you can enable IntelliTrace, but you would have to add the add-in by hand." What add in, and what does it mean to add the add-in by hand? The answer there also refers to this blog post, but that discusses only how to enable IntelliTrace for applications that have already been deployed to the Windows Azure cloud and does not address using IntelliTrace in the Development Fabric.

Intellitrace doesn't work against the local dev fabric. You have to deploy your application to get Intellitrace to work. More about debugging Azure apps here.

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.

An error occured while processing your request

I've just taken this tutorial about how to create a .NET Core with SQL DB.I get the following error message the webapp created as part of this process. I would appreciate some pointers as to what can be done to fix the problem indicated in error. Thanks
Error.
An error occurred while processing your request. Development Mode
Swapping to Development environment will display more detailed
information about the error that occurred. Development environment
should not be enabled in deployed applications, as it can result in
sensitive information from exceptions being displayed to end users.
For local debugging, development environment can be enabled by setting
the ASPNETCORE_ENVIRONMENT environment variable to Development, and
restarting the application.
You could try to set the environment variable inside the web app on azure.
Open the Application Settings blade and go down to the "Application Settings" section to add the "ASPNETCORE_ENVIRONMENT" and "Development".
Refer to this article which provides an overview of the tasks that are required to publish a visual studio web project to a server where others can access the application over the Internet.
Also, you could use azure SQL Database to connect to web app on azure.

Attach debugger to ASMX service on Azure app service

I have an old service that we have deployed up into Azure using an App Service (type: Web App). I publish this asmx direct from Visual Studio 2015 Professional. It works really well accept I cannot attach the VS 2015 Pro debugger to an instance of my ASMX.
I have set everything up correctly (so I think) in Azure and I am deploying with a Debug configuration:
But when I attach the debugger from VS - no errors are shown, it appears successful up until I set a new breakpoint, I get this (I have confirmed that I am attached to w3wp.exe):
I get a "hollow" breakpoint and the error:
The breakpoint will not currently be hit. No symbols have been loaded
for this document.
I get what this error is, what I don't get is how can I successfully attach the debugger to an ASMX service on azure?
Is attaching a debugger to ASMX on azure not supported?
Figured it out. Despite everything looking like it was attached, it wasn't. I had to go to Debug > Attach to Process > and specify the website.
Using the remote debugging option on both Cloud Explorer and Server Explorer does not work in my scenario.
For a better walk through:
https://msdn.microsoft.com/en-us/library/dd434211(v=vs.100).aspx
The real issue:
Azure does not play nice with < .net 4
After upgrading the package to 4.5.2 I could do the following:
Attach the debugger from VS
Use the ConfigurationManager class to get application settings and connections strings from Azure
Plus a few other basic Azure features.
Bottom-line, update .net before publishing

Hook up visual studio profiler to Azure Service Instance

i am not sure if this is the correct place to put of this question as this has nothing to do with coding but rather configuration. My apologies.
I want to hook up my visual studio 2012 profiler to a azure service WaWorkerHost.exe which is hosted on Windows Azure.
After much searching i found Profiling Cloud Service. But this shows only how to profile WaWorkerHost.exe which is currently running on localhost i.e. on Azure Simulator rather than on actual Cloud.
Any help will be appreciated.
Thank you
Not sure if this is something you're looking for, but you can enable profiling when you publish your cloud service through Visual Studio.
and here's a link which talks more about it: http://msdn.microsoft.com/library/hh369930.aspx.

Published Web app to Azure, how do I browse to it, monitor it?

I have created my first app for azure. It's has an MVC3 web role which writes some data to table storage.
It also has a worker role that does some work behind the scenes to the same data.
It all works fine in the emulator.
I've uploaded it all to Azure as a staging deployment, the hosted service it is reports all roles as "ready". The health for all roles is "healthy", though the worker role appears to crash and goes to "degraded" and then resets itself (I assume this is what is happening).
So what now? I have found a "DNS Name" on my Web Role in the form "http://{guid}.cloudapp.net/"
Clicking on that link just gives me a network access error, http://www.downforeveryoneorjustme.com/ can't find it either.
What am I missing? Where can I see diagnostics similar to the emulator? I've set "Enable Diagnostics" to use my Azure storage account in each role. How do I get into the storage to see if it has traced anything? Can this be done through the Management Portal?
I've tried searching through MSDN, but I can't find a page that says "and then you click the DNS name link and your website will launch. I'm sure there is a lovely page like that but I can't find it.
thanks in advance!
In August 2011, the Windows Azure role templates were updated to work with the ASP.NET Universal Providers. As such, when you create a new project, the session state provider is backed by SQL Express by default. If you don't change this to SQL Azure or Cache (or disable session state), you'll run into issues.
I'm not sure this is exactly the issue you're running into, but it's a common one. See Nate Totten's blog post for more information about this (Nate calls out this issue a few pages down, under IMPORTANT NOTE).
You can access diagnostics data directly from Visual Studio Server Explorer.
Here you have all necessary information: Browsing Storage Resources with Server Explorer http://msdn.microsoft.com/en-us/library/windowsazure/ff683677.aspx
Personally I use Azure Diagnostics Manager from Cerebrata http://www.cerebrata.com/products/AzureDiagnosticsManager/ that is easy and has a good dashboard

Resources