How to take web app offline while publishing?

前端 未结 2 1801
悲&欢浪女
悲&欢浪女 2020-12-09 14:46

Very often, when I hit Publish in VS13, I get the site to compile but when uploading I get the error saying that a file is busy.

Updating fil

相关标签:
2条回答
  • 2020-12-09 15:15

    The Azure App Service Deployment Task has a checkbox for this (from version 2.0 onwards), under Additional Deployment Options: Take App Offline. Check that and you should be good to go.

    Take Application Offline: Select the option to take the AzureRM Web App offline by placing an app_offline.htm file in the root directory of the Web App before the sync operation begins. The file will be removed after the sync operation completes successfully.

    Screenshot:

    0 讨论(0)
  • 2020-12-09 15:16

    You actually configure it in the publishing profile (.pubxml). Just add the element to the PropertyGroup like this:

    <PropertyGroup>
      <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
      ...
    </PropertyGroup>
    

    More in this MSDN document

    0 讨论(0)
提交回复
热议问题