Publishing Azure service with auto-negotiation gives error ERROR_SITE_SWAP_OPERATION_IN_PROGRESS

I am trying to publish an AppService using hot-swap with auto-swap . I can do this without any problems through Visual Studio, but not with CI, which uses progile publishing and cannot complete the publication with the following error:

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ Web \ Microsoft.Web.Publishing.targets (4276.5): Error msdeploy ERROR_SITE_SWAP_OPERATION_IN_PROGRESS: Internet deployment task failed. (The site is currently being exchanged. More at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_SWAP_OPERATION_IN_PROGRESS .)

Despite the fact that I am getting an error, the publish and auto-replace operations are performed without problems. The error, however, interferes with my execution of the CI job.

My publication profile:

 <?xml version="1.0" encoding="utf-8"?> <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://my-cool-site-swap.azurewebsites.net</SiteUrlToLaunchAfterPublish> <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish> <ExcludeApp_Data>False</ExcludeApp_Data> <MSDeployServiceURL>my-cool-site-swap.scm.azurewebsites.net:443</MSDeployServiceURL> <DeployIisAppPath>my-cool-site-swap</DeployIisAppPath> <RemoteSitePhysicalPath /> <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod> <EnableMSDeployBackup>True</EnableMSDeployBackup> <UserName>$my-cool-site__swap</UserName> <Password>...password...</Password> <AllowUntrustedCertificate>True</AllowUntrustedCertificate> <_SavePWD>True</_SavePWD> <_DestinationType>AzureWebSite</_DestinationType> </PropertyGroup> </Project> 

And the CI command to run it:

C: \ Program Files (x86) \ MSBuild \ 14.0 \ Bin \ MSBuild.exe "/ p: Configuration = Release" / p: Platform = any processor "/ p: DeployOnBuild = true / P: PublishProfile = my-cool profile

UPDATE: I found that the website binaries are correctly entered, and the webjobs libraries are outdated and are not pushing for these deployments. It seems like an automatic swap is triggered before msdeploy clicks on the webjobs part of the binaries, so I am deprecated by webjobs and publishing errors.

What could be wrong with the publication profile or the way it is done?

+5
source share

Source: https://habr.com/ru/post/1273517/


All Articles