If you want to make Retrace part of your deployment configuration so that it’s installed automatically, you can do the following in your startup script.
Downloading the Azure Installation Zip File
To start, log in to the Retrace web portal and navigate to the Getting Started Page. Click on .Net then the Azure Cloud Service link.
Prepare the Project
Unzip the zip file from the previous step. Include the Install.cmd and Install.ps1 files in the solution of the website or worker process that is being deployed. This should be at the root of the project. Be sure to set build action in Visual Studio to Copy Always on these two files.
Note: If you are running Node.js in an Azure role, you will need the Install.cmd and Install.ps1 files to be in the bin directory of your web role, not in the root.
Include this startup task in the ServiceDefinition.csdef of the Azure project in the solution:
<Startup> <Task commandLine="Install.cmd" executionContext="elevated" taskType="background"> <Environment> <Variable name="ACTIVATIONKEY" value="[your Stackify Activation Key]" /> <Variable name="ENVIRONMENT" value="'[Environment name]'" /> </Environment> </Task> </Startup>
Of course, replace [your Stackify Activation Key] with your real activation key (which you will find on first login, or under your Settings -> Client Info page), and [Environment name] with an environment name that reflects the environment that your application and roles will be running within.
Environment name can be anything you choose, and the only real key here is to be sure you’re consistent with your use of Environment (i.e. don’t deploy Staging resources with Environment set to Production).
Note: Also, notice that for [Environment Name] there is a single quote nested inside of the regular quote (” ‘…‘ “). Please make sure you use this style of inner single quote for any environment names that include a space to ensure the whole value is utilized.
Install with APM+ Disabled
By default, for Web Roles, the Install.ps1 file will be configured to enable APM+ by default. If you do not want to have APM+ enabled, add the ENABLEPROFILER=0 switch to the Install.ps1 script located in the zip file. To enable profiling for Worker Roles, edit the file and set ENABLEPROFILER=1.
$args >> output.txt $key = $args $env = $args $storagedir = $pwd $webclient = New-Object System.Net.WebClient $url = "http://s1.stackify.com/Account/AgentDownload" $file = "$storagedirStackifyInstall.exe" $webclient.DownloadFile($url,$file) & $file /s /v"ACTIVATIONKEY=$key ENVIRONMENT=`"$env`" ENABLEPROFILER=0 /qn /l*v .Log.txt"
Advanced Azure Installation
For more on advanced Azure installation techniques, have a look at: FAQ: How Do I Avoid Deploying the Stackify Agent in Azure on Roles I Do Not Want to Monitor?.
If you’re installing on a running Azure role, you can remote in to the server to install for a normal installation. .NET Agent Installation: Overview
Want to use Retrace with an Azure App Service? Azure Installation: Configure App and Cloud Services