question

sanm-7576 avatar image
1 Vote"
sanm-7576 asked bhargaviannadevara-msft commented

Not able to deploy SpeechAPI on azurewebsite getting error "“Web Deploy cannot modify the file on the Destination because it is locked by an external process.”"

Hi,I have .Net Core 5 API which internally using cognitive services (Speech to text). when i am trying to release it on azure webapp. i am getting below error(shown in image). though it is working in locally and local IIS as well.

123965-azurebuilderror.png


azure-webappsazure-cognitive-services
azurebuilderror.png (72.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

bhargaviannadevara-msft avatar image
0 Votes"
bhargaviannadevara-msft answered bhargaviannadevara-msft commented

@sanm-7576 Thanks for reaching out. This error occurs when a destination file cannot be overwritten or deleted because it is currently in use.

Please check if the following help:

  • Try restarting your web app

  • Make sure that the destination file is not in use before performing a sync. Consider taking the application offline during the sync by enabling the appOffline rule. You can configure the appOffline rule in the publishing profile (.pubxml).
    Add the EnableMSDeployAppOffline element to the PropertyGroup like this:
    <PropertyGroup>
    <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
    </PropertyGroup>

  • Add MSDEPLOY_RENAME_LOCKED_FILES=1 in your webapp's application settings. When set, it enables web deploy to rename files that are locked during app deployment.

Check this blog post for other available approaches to fix the error.

Hope this helps. Do let us know if you have further questions.



If an answer is helpful, please "Accept answer" and/or "Up-Vote" which might help other community members reading this thread.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks. I tried all these possible solution but unfortunately issue still persist. though it is working in IIS hosted

0 Votes 0 ·

@sanm-7576 Do any of the other publishing methods like deploying to an Azure target or Zip deploy work?
Here is some additional guidance for troubleshooting locked files during deployment: Dealing with locked files during deployment

0 Votes 0 ·
sanm-7576 avatar image sanm-7576 bhargaviannadevara-msft ·

Thanks it was some application issue . When I commented IsDevelopment then i was able to see error and fix it.

1 Vote 1 ·
Show more comments