Problem
For Azure web apps using the NewRelic.Azure.WebSites.Extension, and deployed with Azure Pipelines, the newrelic directories are deleted, so no instrumentation occurs. Further attempts to deploy using the Azure Pipeline indicate that the NewRelic.Azure.WebSites.Extension is already installed, so the extension cannot be re-installed using the Azure Pipeline.
Solution
To control newrelic folder retention, use the following options for WebDeploy:
Basic solutions | Comments |
|---|---|
Enable | Explicitly exclude specific folders from deletion, such as the Azure Pipelines UI: Add these arguments to the Azure App Service deploy -> Additional Deployment Options -> Additional Arguments OR
add the following Note the escaped single quotes. |

Cause
If the Remove additional files at destination option is selected for the AzureRmWebAppDeployment task in the Azure Pipeline, the newrelic and newrelic_core directories are deleted from wwwroot, but the extension is not considered uninstalled by Azure. As a result, the next time the pipeline runs and attempts to install the extension, the pipeline displays the message Extension 'NewRelic.Azure.WebSites.Extension' already installed. The extension cannot run without its folders, and Azure will not re-install it because it considers it still installed.