This topic describes how to get started with AppDynamics for Windows Azure.
Add the .NET Agent to Windows Azure Roles and Modify Startup
Publish the AppDynamics-Instrumented Application to Windows Azure
AppDynamics is an application performance monitoring solution that helps you:
Identify problems, such as slow and stalled user requests and errors, in a production environment
Troubleshoot and isolate the root cause of such problems
There are two components in AppDynamics:
Application Server Agent: The Application Server .NET Agent collects data from your servers. You run a separate Agent on every role instance that you want to monitor. You can download the Agent from the AppDynamics portal.
AppDynamics Controller: The Agent sends its information to an AppDynamics Controller hosted service on Windows Azure. Using a web browser-based console, you log into the Controller to monitor, analyze and troubleshoot your application.

Visual Studio 2010 or later
A Visual Studio solution to be monitored
Windows Azure SDK
Windows Azure account
You can register for an AppDynamics account from either the Windows Azure Store or the Windows Azure Marketplace. We recommend Windows Azure Store for Azure application developers because it is built right into the Windows Azure Developer Portal, thus making discovery, acquisition and usage of premium services such as AppDynamics a seamless experience.
To register for an AppDynamics for Windows Azure account from Windows Azure Store (recommended):
Log in to your Windows Azure Developer Portal account at http://windows.azure.com.
Click +NEW at the bottom left corner of the portal.
In the left menu, click STORE.
In the left menu of the Choose an Add-on page click APP SERVICES.
In the list of app services, locate and click AppDynamics.
In the right panel select the Lite plan.
The Lite plan gives you a free version of AppDynamics Pro for Windows Azure with full functionality. The Pro downgrades after 30 days to a free version of AppDynamics Lite for Azure with limited functionality. You do not need to provide a credit card for this option. You can upgrade to AppDynamics Pro for Windows Azure at any time after the 30-day trial by clicking Upgrade on your AppDynamics for Azure landing page.
Click the NEXT arrow in the bottom right corner of the screen to access the registration form.
In the NAME field, enter a name that is unique to your Azure subscription.
Select your region from the dropdown list.
Click the NEXT arrow to continue.
Click the PURCHASE checkmark to complete registration.
AppDynamics appears in the list of add-ons for your Windows Azure subscription under the name you assigned.
Select the AppDynamics add-on and click MANAGE at the bottom of the page.
You will land on your AppDynamics account home page.
To register for an AppDynamics for Windows Azure account from Windows Azure Marketplace:
Click Try Free or Sign Up for AppDynamics on the Windows Azure Marketplace at https://datamarket.azure.com/application/f9949031-b8b9-4da5-b500-c615f3f2a7cd.
If you choose Sign Up, you receive a free version of AppDynamics Pro for Windows Azure with full functionality, which downgrades after 30 days to a free version of AppDynamics Lite for Azure with limited functionality. You do not need to provide a credit card for this option. You can upgrade to AppDynamics Pro for Windows Azure at any time.
If you choose Try Free, you receive a free version of AppDynamics Pro for Windows Azure with full functionality. You need to provide a credit card for this option. After 30 days your credit account will be charged for continued use of AppDynamics Pro for Windows Azure, unless you cancel your subscription.
You need one agent license for each role instance that you wish to monitor. For example, a site running 2 Web role instances and 2 Worker role instances requires 4 agent licenses.
On the registration page, provide your user information, a password, email address, company name, and the name of the application you are monitoring as you will publish it with Windows Azure.
Click Register Now.
You will receive your AppDynamics credentials and the AppDynamics Controller URL (host and port) assigned to your account in an email sent to the address you provide on the sign-up page. Save this information.
If you already have AppDynamics credentials from another product, you can sign in using them.
You will also be given an AppDynamics account home page.
You will land on your AppDynamics account home page.
Your AppDynamics account home page includes:
Controller URL: from which to log into your account on the AppDynamics controller hosted service
AppDynamics credentials: Account Name and Access Key
Link to the AppDynamics download site: from which to download the AppDynamics .NET Agent
Number of days left in your Pro trial
You can access your AppDynamics account home page at any time by entering its URL in a web browser and signing in with your AppDynamics credentials.
Navigate to the AppDynamics download site. The URL is in your welcome email and on your AppDynamics account home page.
Log in with your AppDynamics account name and access key.
Download the file named AppDynamicsdotNetAgentSetup64.msi. Do not run the file.
This step instruments the roles in your Visual Studio solution for monitoring by AppDynamics. There is no traditional Windows wizard-style installation procedure required to use AppDynamics for Windows Azure.
Either create a new Windows Azure project in Visual Studio or open an existing Windows Azure project.
If you created a new project, add the Web role and/or Worker role projects to the solution.
To each Web and Worker role project that you want to monitor add the downloaded .NET Agent .msi file.
Note that while each role project has a single attached .NET Agent .msi, each role instance in the project requires a separate .NET Agent license.
To each Web and Worker role project that you want to monitor add a text file named startup.cmd and paste the following lines in it:
REM Bypass the installation if already installed
if defined COR_PROFILER GOTO END
SETLOCAL EnableExtensions
REM Run the agent installer
AppDynamicsdotNetAgentSetup64.msi AD_Agent_Environment=Azure AD_Agent_ControllerHost=%1 AD_Agent_ControllerPort=%2 AD_Agent_AccountName=%3 AD_Agent_AccountAccessKey=%4 AD_Agent_ControllerApplication=%5 AD_Agent_ControllerSSLEnabled=%6 /quiet /log d:\adInstall.log
REM Reboot the machine after installation in order to restart role CLR and attach AppDynamics Agent to it
SHUTDOWN /r /c "Reboot after installing the AppDynamics .NET Agent" /f
GOTO END
:END
For each Web and Worker role that you want to monitor, set the Copy to Output Directory property for the AppDynamics agent .msi file and for the startup.cmd file to Copy Always.

In the ServiceDefinition.csdef file for the Windows Azure project, add a Startup Task element that invokes startup.cmd with parameters for each WorkerRole and WebRole element.
Add the following lines:
<Startup>
<Task commandLine="startup.cmd [your_controller_host] [your_controller_port] [your_account_name] [your_access_key] [your_application_name] false" executionContext="elevated" taskType="simple"/>
</Startup>
where:
your controller host and your controller port are the Controller host and port assigned to your account, and your account name and your access key are the credentials assigned to you by AppDynamics. This information is provided in the email sent when you registered with AppDynamics and also on your AppDynamic home page. See Register for an AppDynamics Account.
your application name is the name you choose for the application. This name will identify the application in the AppDynamics Controller interface.
Your ServiceDefinition.csdef file will look something like this:

For each AppDynamics-instrumented role project:
In Visual Studio, select the role project.
Select Publish to Windows Azure.
Log into the AppDynamics Controller at the URL given in your welcome email and on your AppDynamics account home page.
Send some requests to your application so there is some traffic to monitor and wait a few minutes.
In the AppDynamics Controller, select your application.
Monitor your application.
See your AppDynamics account home page for links to documentation and videos.
The latest updates to this document are in the wiki version at http://docs.appdynamics.com/display/ADAZ/How+To+Use+AppDynamics+for+Windows+Azure.