azure-pipelines-tasks: Azure Function deploy fails with The user name or password is incorrect

Environment

I’m using VSTS

  • Account name: stamp-dev
  • Release name: Stamp BigBro
  • Release number: BigBro-Dev-30
  • Agent: Hosted Agent (2.129.1)

Issue Description

I use Azure Service App Deploy to deploy an Azure Function to my Azure environment, and I keep on getting an error saying that username & password are incorrect.

If I delete the Azure Function and I create it again, the deployment works the first one/two times, than I get the same error.

Error logs

2018-02-26T00:23:18.1593970Z ##[error]Failed to deploy web package to App Service. 2018-02-26T00:23:18.1611382Z ##[debug]Processed: ##vso[task.issue type=error;]Failed to deploy web package to App Service. 2018-02-26T00:23:18.1612518Z ##[debug]{} 2018-02-26T00:23:18.1613194Z ##[debug]System.DefaultWorkingDirectory=D:\a\r1\a 2018-02-26T00:23:18.1618200Z ##[error]Error: (2/26/2018 12:23:18 AM) An error occurred when the request was processed on the remote computer. Error: The user name or password is incorrect.

at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path) at Microsoft.Web.Deployment.DirectoryEx.CreateDirectoriesFromRoot(String path) at Microsoft.Web.Deployment.AppOfflineRuleHandler.AddAppOfflineFilesToEachApp(DeploymentBaseContext baseContext, Boolean whatIf) at Microsoft.Web.Deployment.AppOfflineRuleHandler.Add(DeploymentSyncContext syncContext, DeploymentObject destinationObject, DeploymentObject& sourceObject, Boolean& proceed) at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject) 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, Nullable1 syncPassId, String syncSessionId) at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable1 passId, String user, String siteName) Error count: 1.

2018-02-26T00:23:18.1622543Z ##[debug]Processed: ##vso[task.issue type=error;]Error: (2/26/2018 12:23:18 AM) An error occurred when the request was processed on the remote computer.%0D%0AError: The user name or password is incorrect.%0D%0A%0D%0A at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)%0D%0A at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)%0D%0A at Microsoft.Web.Deployment.DirectoryEx.CreateDirectoriesFromRoot(String path)%0D%0A at Microsoft.Web.Deployment.AppOfflineRuleHandler.AddAppOfflineFilesToEachApp(DeploymentBaseContext baseContext, Boolean whatIf)%0D%0A at Microsoft.Web.Deployment.AppOfflineRuleHandler.Add(DeploymentSyncContext syncContext, DeploymentObject destinationObject, DeploymentObject& sourceObject, Boolean& proceed)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)%0D%0A at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)%0D%0A at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable1 syncPassId, String syncSessionId)%0D%0A at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable1 passId, String user, String siteName)%0D%0AError count: 1.%0D%0A 2018-02-26T00:23:18.1625647Z ##[debug]rm -rf D:\a\r1\a\error.txt 2018-02-26T00:23:18.1626072Z ##[debug]removing file 2018-02-26T00:23:18.1626432Z ##[debug]task result: Failed 2018-02-26T00:23:18.1627049Z ##[error]Error: C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe failed with return code: 4294967295

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

This error usually happens if you delete or regenerate the keys for the storage account associated with the function app. The one defined in the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING App Settings for the functionapp.

If you deleted that storage account, you can try recreating it and updating the app settings that point to it. Check for WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, AzureWebJobsDashboard, AzureWebJobsStorage

If you just regenerated the keys for that account, then update the connection strings in the App Settings for your app.

I have been having the same issues here today. After reading the above and the troubleshooting issues document I know what I have done wrong, but it would be nice if the error handling on publish provided a meaningful error and also the Azure Portal could do some validation to stop you from removing required configuration settings. I normally created Azure Functions using my Web App resources, but today ran out of available resources so made one under the consumption plan. I copied my configuration from an existing Azure Function, which caused the issue.

So my problem was due to the fact that the task for replacing the variables was deleting WEBSITE_CONTENTSHARE and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. So the first time VSTS was able to deploy because the variables where there, the task to set the variables was executed after…so the second time it was failing because of the missing variables.

@ahmelsayed I’ve a task to add variables to the AppSettings, but the task removes all the variables so I’m missing WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. Do you think that could be the problem?