VSTS - Automation for Azure Function issue

VSTS - Automation for Azure Function issue

I create build Azure function project using VSTS and run successfully. But when I run Release it worked fine for first time, But when I run release next time for the same build definition, it gave me below error.

Error:

Web Deploy cannot modify the file 'DemoApp.DemoFunctions.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE. Error count: 1.
 

Solution:

1. Login to Azure portal

2. Goto function app and open your function app
3. Click on "Application settings" from Overview tab.
4. Goto "Application settings" section on "Application settings" page.
5. Add MSDEPLOY_RENAME_LOCKED_FILES = 1
6. Save settings from top left corner.
7. Redeploy your Azure function, it will work.

Hope this will help you and save your time.

Enjoy !!!

:)

No comments:

Post a Comment