Azure Pipelines wipes out NewRelic.Azure.WebSites.Extension directories


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.


To control newrelic folder retention, use the following options for WebDeploy:

Basic solutions Comments

Enable skipAction=Delete WebDeploy arguments.

Explicitly exclude specific folders from deletion, such as the newrelic folders, with the following:

Azure Pipelines UI:

Add these arguments to the Azure App Service deploy -> Additional Deployment Options -> Additional Arguments

-skip:skipAction=Delete,objectName=dirPath,absolutePath='newrelic$' -skip:skipAction=Delete,objectName=dirPath,absolutePath='newrelic_core$'


Pipeline.yml file:

add the following input to the WebDeploy task:

AdditionalArguments: '-skip:skipAction=Delete,objectName=dirPath,absolutePath=''newrelic$'' -skip:skipAction=Delete,objectName=dirPath,absolutePath=''newrelic_core$'''

Note the escaped single quotes.



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.

For more help

If you need more help, check out these support and learning resources: