Morgan
Morgan

Reputation: 486

Publishing Azure functions

I work with several azure functions on a project that I didn't setup on my own, and when I try to publish the project which includes those azure functions to update them, the publishing failed with the following error :

Web deployment task failed. (Connected to the remote computer ("demo.scm.azurewebsites.net") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site.

Where do I provide credentials ?

Upvotes: 2

Views: 5327

Answers (2)

Kzryzstof
Kzryzstof

Reputation: 8382

Here are the steps to publish an Azure Function from Visual Studio.

  1. Go to the Azure Portal
  2. Go to your Function App.
  3. Then, select Overview and click Get publish profile and save the file.

Overview

  1. Next, go to your Visual Studio project.
  2. Right-click on your Azure Function project.
  3. Select Publish and then Import Profile.
  4. Finally, hit publish.

All the information needed, including your missing credentials, is in that the profile.

Upvotes: 2

user3459730
user3459730

Reputation: 379

I have the exact same issue. Tried to publish and get the exact same error. I did as kzrystof suggested and downloaded the publish profile from the Azure portal and imported it into VS2017. As soon as I pick the publish profile file and click the open button I get the "Publish failed" error message. I checked the output window to find out what the error was, but there is nothing new added to the output. I cleared the output window and clicked the Publish button and immediately receive the "Publish failed" error popup with no further details in the output window.

Update: I was able to successfully publish the Azure Function App by creating a new profile in VS2017 to a new instance up on Azure. I then removed the old instance from the Azure Portal. Successive attempts to publish from VS2017 then worked successfully.

Just as a test, I downloaded the publish profile from the Azure Portal for this new AF app and imported it into VS2017 and still this produces the same "Publish failed" error popup. MS still seems to need to do some work on that scenario.

Also, there still seems to be problems with ZipDeploy so avoid it for now. I keep having timeouts when trying to publish using ZipDeploy. Standard WebDeploy publishes the files individually and thus doesn't have timeout issues.

Upvotes: 1

Related Questions