Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Deploy to Azure doesn't force Web App to pickup new changes

I have an automatic deployment configured from my GIT to Azure App using Web Deploy. Every time when new code pushed to the repo, build is started, then deployed to the Azure with Web Deploy.

The issue is that Web App (ASP.NET MVC) continue to serve requests using the deployed code, and the file replacement doesn't really affect it. Even if web.config was changed. Basically, the only way I can force the new app to loaded is to restart it (or stop/start) manually.

here is my publishig profile:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
    <PublishProvider>AzureWebSite</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>https://app-name.azurewebsites.net</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>app-name.scm.azurewebsites.net:443</MSDeployServiceURL>
    <DeployIisAppPath>app-name</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>$app-name</UserName>
    <Password>...</Password>
    <AllowUntrustedCertificate>True</AllowUntrustedCertificate>
    <_SavePWD>True</_SavePWD>
    <_DestinationType>AzureWebSite</_DestinationType>
  </PropertyGroup>
</Project>

similar topic at msdn with no answer

like image 1000
Alexey Strakh Avatar asked Feb 07 '17 06:02

Alexey Strakh


1 Answers

David has already shared his insights. There is an alternate way to tackle this scenario through the use of Deployment Slots. You can create a slot and then configure Auto-Swap to tackle this. This has added benefits of zero cold start and zero downtime.

See this for more info: Configure Auto Swap

like image 168
Kaushal Kumar Panday Avatar answered Dec 18 '22 08:12

Kaushal Kumar Panday