Deploy AppMon agents in MS Azure cloud service

Overview

This guide describes the steps necessary to setup AppMon Agents in Microsoft Azure Cloud-Services.

The installation uses Powershell scripts available from  https://github.com/dynatrace/dynatrace-powershell to install the necessary agents, executed by a startup-task.

In this guide, WebRole installs agents to monitor IIS and ASP.NET. WorkerRole installs .NET agent to monitor WaWorkerHost.exe.

Prior to Deployment

  1. Download one of the following one of the following All Agents for Windows installers:

    1. The community portal.
    2. The public download location at http://downloads.dynatracesaas.com
      .
  2. Download scripts and modules from https://github.com/dynatrace/dynatrace-powershell.

Add necessary files to your solution

WebRole

Within the App_Data folder, create a new folder named with a descriptive name. For example, DynatraceSetup.

Put all powerhsell scripts, modules, and the agent installer (.msi) into this folder.

Add a new startup script to your solution that calls scripts/InstallAgentsInAzureWebRole.ps1.
For example:

@echo off
DATE /T >> c:\Dynatrace-InstallAgentsInAzureWebRole.log 2>&1
TIME /T >> c:\Dynatrace-InstallAgentsInAzureWebRole.log 2>&1
cd App_Data\DynatraceSetup\scripts
powershell -NoProfile -ExecutionPolicy unrestricted -File InstallAgentsInAzureWebRole.ps1 -InstallerPath "../" >> c:\Dynatrace-InstallAgentsInAzureWebRole.log 2>&1
exit /B 0

Ensure your files to be copied to the output directory, setting their properties:
Copy-To-Output Directory:  "Copy Always"
Build-Action:  "Content"

WorkerRole

Within your solution create a new folder with a descriptive name. For example, 'DynatraceSetup'.

Put all powerhsell scripts, modules, and the Dynatrace .msi into this folder.

Add a new startup script to your solution that calls scripts/InstallAgentsInAzureWorkerRole.ps1. For example:

@echo off
DATE /T >> c:\Dynatrace-InstallAgentsInAzureWorkerRole.log 2>&1
TIME /T >> c:\Dynatrace-InstallAgentsInAzureWorkerRole.log 2>&1
cd DynatraceSetup\scripts
powershell -NoProfile -ExecutionPolicy unrestricted -File InstallAgentsInAzureWorkerRole.ps1 -InstallerPath "../" >> c:\Dynatrace-InstallAgentsInAzureWorkerRole.log 2>&1
exit /B 0

Set the following properties on the files to be copied to the output folder: 
Copy-To-Output Directory:  Copy Always
Build-Action: Content

Configure cloud-service's ServiceDefinition file

  1. Add configuration keys
    For minimum configuration at least 2 keys are required:
    1. DTCollectorHost
    2. DTInstaller

For further details on additional configuration options, see description within either scripts/InstallAgentsInAzureWebRole.ps1 or scripts/InstallAgentsInAzureWorkerRole.ps1.

  1. Add the startup-task.