Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is going wrong with web deployment from Visual Studio and App service?

Suddenly Web Deployment started failing.

Could not find file 'D:\home\site\wwwroot\App_Offline.htm'. 

I stopped the service, but deployment still fails.

When I tried to delete any file from wwwroot in Kudu PowerShell UI I get error "404 file not find", but that file is still displayed after refresh. When I tried to delete file directly in powershell I get error

Cannot remove item D:\home\site\wwwroot\Azure.Storage.dll: Invalid access to memory location. At line:1 char:1 + del .\Azure.Storage.dll + ~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : WriteError: (D:\home\site\wwwroot\Azure.Storage.     dll:FileInfo) [Remove-Item], IOException     + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell     .Commands.RemoveItemCommand 

I deleted the service, recreated it and the first deployment from Visual Studio was Ok. But next day deployment failed again. The only thing between that deployments was deployment from VSTS. But I was able to deploy from VSTS and from Visual Studio in any order before without any problem.

I'm the Owner of that App Service.

Deployment log.

(2018-08-06 13:05:03) An error occurred when the request was processed on the remote computer. Could not find file 'D:\home\site\wwwroot\App_Offline.htm'.    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)    at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)    at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings)    at Microsoft.Web.Deployment.AppOfflineRuleHandler.AddAppOfflineFilesToEachApp(DeploymentBaseContext baseContext, Boolean whatIf)    at Microsoft.Web.Deployment.AppOfflineRuleHandler.AddChild(DeploymentSyncContext syncContext, DeploymentObject destinationParentObject, DeploymentObject& sourceObject, Boolean& proceed)    at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)    at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)    at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)    at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId, String user, String siteName) Publish failed to deploy. 
like image 560
Rambalac Avatar asked Aug 06 '18 04:08

Rambalac


People also ask

Can't connect to remote server web deploy?

This error indicates that you cannot connect to the server. Make sure the service URL is correct,firewall and network settings on this computer and on the server computer are configured properly,and the appropriate services have been started on the server.

How do you check web deploy is installed or not?

Is Web Deploy installed? You can verify web deploy is installed by going to the "Programs and Features" control panel and looking for "Microsoft Web Deploy 2.0" in the list of installed programs. If it is not there, you can install it via the Web Platform Installer by going to the "Products" tab.

How do I connect to Azure App Service from Visual Studio?

Open your project in Visual Studio. In Solution Explorer, right-click the Connected Services node, and, from the context menu, select Add Connected Service. In the Connected Services tab, select the + icon for Service Dependencies. In the Add Dependency page, select Azure App Configuration.


2 Answers

All of a sudden VSTS default deployment mode became Run-From-Zip.

The solution is setting Select deployment method checkbox in VSTS deploy and be sure Web Deploy is selected.

To "unlock" the service you need to delete setting WEBSITE_RUN_FROM_PACKAGE from Application settings page in the Azure Portal - it is under 'Configuration'

enter image description here

like image 57
Rambalac Avatar answered Sep 23 '22 15:09

Rambalac


I hade the same problem today with net core 2.2 and the solution was to remove setting "WEBSITE_RUN_FROM_PACKAGE" in azure appsettings

like image 23
joakimja Avatar answered Sep 23 '22 15:09

joakimja