Azure Function: Web Deploy cannot modify the file on the Destination because it is locked by an external process

Recently, while deploying Azure Function from Visual Studio, we got an error “Web Deploy cannot modify the file on the Destination because it is locked by an external process”.

To fix this issue, we created an application setting. There are 2 ways to do this:

  1. Create an Application Setting in the Function App in Azure portal:
    MSDEPLOY_RENAME_LOCKED_FILES = 1

Or,

2. Create and Application Setting in the Publish profile for the respective Function App in Visual Studio.

Click on Manage Azure App Service Settings.

Click on Add Setting -> Add setting named “MSDEPLOY_RENAME_LOCKED_FILES” -> Click OK.

Put the value as 1.

After creating the Application Setting when we deployed the Azure Function, it was deployed successfully.

Hope it helps !!

Advertisement

One thought on “Azure Function: Web Deploy cannot modify the file on the Destination because it is locked by an external process

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.