Configure Azure App Services
- Updated on 29 Jun 2018
- 5 minutes to read
Retrace’s powerful web application performance monitoring is fully supported on Azure App Services (Web Apps). All APM related features are supported, such as identifying slow web pages, slow database queries, and viewing complete method level profile traces.
Some basic monitoring features like monitoring IIS metrics, WMI, and performance counters are not supported via Microsoft for App Services, and therefore not supported by Retrace.
Installation Steps for Azure App Services
Retrace is installed as a WebJob that runs on each instance. The WebJob collects the output from the Retrace .NET profiler and uploads it. An Azure Site Extension has been created to simplify the installation process.
Login to the Azure portal and add the Stackify APM site extension. Select Web App -> Tools -> Extensions -> Add -> Select .NET APM Retrace
Via the Azure portal, configure the following App Settings
|Stackify.ApiKey||Required||Use your Stackify Activation Key|
|Stackify.AppName||Optional: Defaults to App Service name||MyWebApp Name|
|Stackify.Environment||Optional: Defaults to "Production"||Production/Staging/etc (Set per slot)|
|Stackify.CollectIISLogs||Optional: Defaults to 0||Further instructions below|
- IMPORTANT: Restart your Web App via the Azure portal. The webjob will not begin to start collecting profiler output until this has been done. 4. Generate some traffic to your site 5. Performance data should show up within a few minutes
Retrace will not start working until you restart your web app! If you are not seeing any data, try restarting your application again via the Azure Portal, and ensure the Stackify WebJob is running.
Multiple deployment slots
If you are using multiple deployment slots, you will want to install the site extension for each deployment slot. This is required so when you are swapping slots everything works correctly, as site extensions are part of what is swapped. Setting Stackify.Environment is also important so we can identify which slot is which.
Controlling App Name and Environment
By default we will show the app name as the same name that would be:
By default, the environment name for all azure web apps is Production. If you want to override this behavior and set the name you can specify a name in your web.config or the azure portal application settings.
We would recommend setting Stackify.Environment for each of your deployment slots and making it a sticky setting per slot.
Collecting IIS Logs
If you are using Retrace's error and log management solution, you can have the Stackify WebJob collect your IIS logs and upload them automatically. You can do this by enabling the log collector feature in Stackify across all servers, or you can enable for just a particular app by setting an Azure portal application setting. Azure portal application settings to enable or disable IIS log collection:
(or 0 to disable)
Note: You must enable web server logs in the azure portal for your app for this to work.
How to update Retrace on Azure Web Apps
Periodically we will release updates. The Stackify WebJob has been designed so that every time it starts it will check for and download the latest version. Restarting your Azure WebApp will force it to update, although some changes may not take effect until your app is restarted once again after the WebJob makes some changes.
Web Deployment Task Failed Error
If you are trying to deploy your application and getting an error about StackifyWebJob files being locked, you may need modify your deployment settings. Stackify runs as a WebJob that is installed via the Azure Site Extension in to your App_Data folder. If you are trying to use the optional deployment setting of "Remove additional files at destination" this would try to remove our WebJob. Error: Web deployment task failed. (Web Deploy cannot modify the file 'StackifyWebJob' on the destination because it is locked by an external process. To fix this, also select "Exclude files from the App_Data folder" so the Stackify WebJob is not affected by the deployment. This setting is shown below in the Visual Studio UI as part of the publish options.
Due to the “sandbox” nature of Azure Web Apps, debugging can be difficult, and can be made more difficult in a “scaled” website with more than one running instance. Stackify’s WebJob and .NET profiler both have log files and Stackify’s support team may ask for your assistance in retrieving them. They are accessed via Azure’s Kudu console.
(rotating file log, may be more than one file). To get to this location, please see this documentation on how to use the Kudu Debug Console for Azure Web Apps. Along with your log files, we have some common troubleshooting steps for your Azure Web App to try as well.
Uninstalling Retrace for Azure Web Apps
Stackify is installed as an Azure Site Extension which installs a WebJob and a .NET CLR profiler. To disable Stackify on your Azure Web App, delete the Azure Site Extension from each deployment slot and restart your app. This should automatically delete the WebJob and disable the CLR profiler. Advanced steps to double check everything is removed:
- Via the Azure portal, delete the Retrace APM site extension for your web app on each deployment slot that it was installed on
- Double check that the StackifyWebJob was properly deleted by viewing the list of WebJobs for your web app.
- Via Kudu ensure that the folder under D:\home\SiteExtensions\Stackify.AzureWebApps is deleted
- Delete everything under D:\home\stackify
- Delete StackifyHttpTracer.dll from the bin folder of your app
If you are having serious problems and need to urgently disable Retrace you can create a new deployment slot that does not have the Stackify extension in it. Redeploy your app to that slot and swap it to production, then delete the old slot and recreate it.
Having problems with Retrace & your Azure App Service?
Check out our article about common problems with Azure App Services: Troubleshoot: Common Azure App Service Issues