Azure Web Apps: Profiler .dll locks during deployment

Problem

When deploying a new version of New Relic's .NET agent (NewRelic.Profiler.dll) for your Microsoft Azure Web App, an error message prevents you from continuing until you stop or restart the process.

Solution

Normally the process stops, then the assets are overwritten by the assets that New Relic packs in the site root (located at D:\Home\site\wwwroot\newrelic) during a deployment. To resolve the problem, try either of these solutions.

Stop the file from releasing

This solution is available for your Azure Web App if you are attempting to deploy a new .NET agent version over an existing version:

  1. Stop your web app to release the .dll file.
  2. Allow the update to proceed.
  3. Once the deploy is complete, restart the instance.
Use the New Relic Site Extension

You can install New Relic's .NET agent into your Azure Web App by using the New Relic Site Extension. (You should only need to install the extension once.)

  1. Navigate to https://yoursite.scm.azurewebsites.net/ and select Site Extensions.
  2. From the Gallery, select the add [plus] icon, then select New Relic.
  3. Follow the instructions to manually add the configuration keys to your web app, and use the option that best fits your needs.

To update the Site Extension: From the Azure Portal, select WebApps > (select your site) > All Settings > Extensions > New Relic.

For more help

Recommendations for learning more: