How do I profile an Azure app running in the Compute Emulator? - azure

I think profiling an application deployed to Azure is not a big deal http://msdn.microsoft.com/en-us/library/hh369930.aspx
I'd like to do the same locally, in the Compute Emulator. It looks like this is currently difficult http://www.pettijohn.com/2011/05/performance-testing-azure-dev-fabric.html at best, at least with the native VisualStudio 2010 profiler.
Am I missing a simple way to do this? Are there any third-party tools that make this fairly easy to do?
I'm using the Azure SDK 1.4 and Azure Tools for Visual Studio 2010 1.3

For later versions of the SDK you can refer to this article in the Windows Azure documentation, where it is explained how to do CPU sampling for both worker roles and web roles: for the latter case, you should attach to the WaIISHost.exe process.
As also indicated in the answer from Marcus Jansson, you may need to attach to the w3wp.exe process. For example, when I'm debugging one of the web sites contained in a web role I need to explicitly attach to the w3wp.exe process that is hosting that site, since Visual Studio does not attach automatically to all relevant IIS instances.
UPDATE 2013-01-10 19:03 UTC I was unable to profile web roles using the linked instructions. I discovered that:
it is useless to attach to WaIISHost.exe, since it seems that it doesn't contain the role code;
I cannot attach to w3wp.exe instances from Visual Studio 2010 (I receive an error message with code VSP1449).
Since I'm using Windows Azure SDK 1.8, I then tried to run my web role under IIS Express (see this post for further details) and then I attached to the iisexpress.exe process. This way I was able to profile my web site.

If you run the web role in IIS, you can just attach to the process w3wp.exe.

I think it depends on what you're trying to profile.
The link you included in your question is for profiling memory for a web role, and yes it looks a little involved.
If you're looking to profile a worker role, it's much easier. You can simply start the worker role through Visual Studio (or using the method mentioned in the post you linked to if you're worried about the effect of the debugger on the profiling) and select Analyze -> Profiler Attach/Detach -> WaWorkerHost. From there it should look just like profiling any other application.

Related

Remote Debugging Azure App Service Site Fails

I'm trying to debug an ASPNET Core/EF Core website hosted on Azure. When I try to attach the debugger in VS 2015, via Cloud Explorer, I get this error message:
Yet when I check the site in the Azure portal, it sure seems like it's 32 bit and set to enable remote debugging:
So what am I missing or doing wrong?
Portal setting controls the bitness of the IIS w3wp process. But ASP.NET Core runs in its own process, so that setting has no effect on it. Instead, what determines whether your .NET Core process runs as 32 or 64 bit is how you publish it.
Given that apparently your Core project is published as 64 bit, you might want to try switching the Portal setting to 64 bit. This will affect the debugger MSVCMON.exe process, which should then allow you to attach.

Debugging WCF services in Visual Studio 2012

How can I tell which of my services is the one that I am trying to debug?
Using the Visual Studio 2010 debugger I would just look for the w3wp (or whatever the heck it was) that was running under the app pool username that my service was running under.
But now in my attach to processs window I have 3 msvmnon.exe processes and I don't see any wcf services running? What am I missing?
What I wasn't doing was checking the show processes from all users.
Set your WCF services project as startup in VS 2010. Then run the project, you will get a window with all services defined on the left side. Click on the service you wish to execute and pass parameters if any

Debugging Azure: Error attaching the debugger to the IIS worker process

I have a web application asp.net to deploy to Windows Azure. I try to run it on local first. But when debugging, I catch this error from VS2010:
"There was an error attaching the debugger to the IIS worker process
for URL 'http://127.255.0.0:82/' for role instance
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0'.
Unable to start debugging on the web server ......."
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me.
I had similar problem with Windows 8, debuging a cloud application with Visual Studio 2012 RTM and Azure SDK 1.71, when trying to launch the application into the compute emulator. It was a very simple app, but I used Azure diagnostics. At the end these are two things I have changed that have work for me, both turning on Windows 8 features (so go to Win8 and open 'Turn Windows Features On/Off'.
Activate the checkboxes for:
Internet Information Services Hostable Web Core
Internet Information Services > World Wide Web Services > Application Development Features > ASP.NET 4.5
Internet Information Services > World Wide Web Services > Health and Diagnostics > Tracing
Internet Information Services > Web Management Tools > IIS Management Scripts and Tools
That worked for me, it makes sense, as I'm using Visual Studio 2012 and trying to get some trace information using diagnostics in Azure.
I hope this will work for you or give some tip about the problem. In the case of being useful information, remember to vote as response or as value tip.
Thanks,
Mike
This usually happens when there's a problem with the project to be deployed to the emulator (WindowsAzureProject2 in your case).
Try the following:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log file for the error messages. See more details in this answer.
Make sure your project can be started without the emulator. It's a web project, so just try to start it as a regular web project. Or publish it to the separate folder and try to create a website in IIS of it.
Check your *.csdef and *.cscfg files to make sure all the configuration is correct.
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to deployment16(6).WindowsAzureProject2.WebApplication3_IN_0, right click --> Explore.... Make sure that this folder is not empty and contains all the files required to start a web project successfully.
BTW, there's a similar question: Debugger can't connect when starting local azure project
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk
I just have today the same problem trying to Debug locally with Azure Storage Emulator in Windows 7. So in the Azure project properties, in Web tab, I checked the radio button 'Use IIS Express' and it debugged without problem. I hope this helps someone.
I encountered this exact same problem when I upgraded an existing Azure solution to the Azure SDK 2.1. After some hunting around I uncovered that the upgrade had automatically set the "Local Development Server" setting to "Use IIS Web Server".
Changing the "Local Development Server" setting to "Use IIS Express" fixed the problem immediately.
To access this setting right-click the Azure cloud project file in your solution, select the "Properties" option, tab down to "Web" and you'll see the following setup.
Also, make sure you run Visual Studio as administrator
Please check the version of emulator you have installed. If your code is created in older sdk and you have a new emulator installed it will give you this error.
Check the version of Azure APIs in your project, go to Project > references and right click on Azure dlls to check the version, same sdk version must be installed on the system, higher are optional as azure 2.x are not backward compatible.

IIS7.5 Debug vs Published permissions

I'm running Visual Studio 2010 and IIS 7.5
My site accesses a specified servers hardware for some statistical analysis.
When I debug my site in Visual Studio, I can access other servers hardware information with now issue. When I publish the site to IIS running as ASP.Net 4.0 appPool because the site is written under the 4.0 framework, the hardware retrieval fails. (note: when I run the site and analyze the local machine hardware, it works perfectly... the problem lies in analyzing another machine on the network.)
My question is, What is the difference in permissions a site is running under when debugging in Visual Studio in comparison to a published site in IIS 7.5?
Things I've tried...
Changing the app pool identity to every possible built in option, and my own domain profile, which is local admin on the machine I'm trying to retrieve hardware info about.
Changing the user that access the file directory of the website.
Changing app pools period. (The site has to run under .net 4.0, or else it barks out bad things).
I'm thinking I may need to install the site directly on the server that's being analyzed, but I find it odd that I can get all the data from other machine when I'm debugging. Any insight someone could bring would be greatly appreciated. Thanks!!
This answer is, in some cases, you have to add the appPool identity running the site to the "Performance Monitoring" group for the local machine in order to allow an ASP.NET site access the server's local hardware resources...

Azure - error on starting with multiple web role projects

If I have more than one webroles(projects, not instances) in my application, I get this error: (I only get it if I attach a web role. It works fine wit as many worker roles projects as I want)
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5100/' for role instance 'deployment(21).CloudPOC.WebRoleToHostDataService.0'. Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Click Help for more information.
OK
What is wrong here? I can't understand it and I need a webservice project!
Make sure you are starting the Azure project rather than the Web Project itself. You might have set the Web Role as the startup project, and if you do that you'll find that IIS runs the Web App rather than the Azure Dev Fabric, meaning any Dev Fabric specific stuff (like config settings per role) aren't available causing problems.
What you're meant to do is let the Azure Dev Fabric (Compute Simulator) fire up all your roles for you, and it'll also work out if it needs to open a web browser etc.
So right click on the Azure Cloud project, set that as the Startup Project, and try again.
Hope that helps,
Andy
EDIT thought of something else!
Make sure your web.config is compiling to allow debug="true". If you have added a new WebSite to your solution, it won't be so by default:
<system.web>
<compilation debug="true" targetFramework="4.0" />
I had similar issue which got resolved with following steps.
Make sure you have correct version of .net framework 4.0 is intalled. (.Net Framework 4.0.30319 is the latest version)
Uninstall if there isany other .Net 4.0 framework in present on your system by going to Add And Remove programs.
Go to %windir%\Microsoft.NET\Framework64 physical location and remove unwanted .Net framework 4.0 folder
I've also had this problem and it happened when I upgraded my app to 4.0... I ran without debugging and got the following error:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
and after researching that error, I found this:
http://forums.asp.net/t/1571308.aspx/1
which says there's currently a bug w/ vs2010 and 4.0... I took the answers recommendation and commented out the extensions section and it worked for me... Another possible solution.

Resources