Gaander
Gaander

Reputation: 81

Azure Web Deploy "Publish Failed"

Hello my fellow developers!

I am currently struggling with a problem in the latest Visual Studio 2017 Professional - Version 15.8(.1).

Since The Update to Version 15.8, I am unable to publish any Azure Function via Web Deploy.

Every time i press the "Publish" button, I simply get an error window saying: "Publish failed". The Output window stays empty, where normally I would get all the build and publishing output.

What I've tired:

My Questions:

I hope someone can point me in the right direction to solve this infuriating issue ;)

Upvotes: 5

Views: 8545

Answers (7)

Indrasen Singh
Indrasen Singh

Reputation: 41

Thing that worked for me was, I had to enable Basic Authentication, which was disabled for me.

AppService -> Configuration -> GeneralSettings -> Basic Authentication -> Set it ON

enter image description here

Upvotes: 0

Mary
Mary

Reputation: 211

Not sure if it'll help anyone, but in my case I had a tab open with KUDU (in advanced tools) console, where I ran my app (dotnet MyApp.dll). It was running there all that time and blocking my publish, so I had to stop it.

Upvotes: 0

davos
davos

Reputation: 211

If it helps anyone I just stopped the app from the Azure portal, published it and started the app again - that worked in my case. Cheers!

Upvotes: 3

Derek Adams
Derek Adams

Reputation: 41

Simply add to the App Service Settings:

FUNCTIONS_EXTENSION_VERSION = ~1 

Both remote and locally.

Upvotes: 0

Kira Hao
Kira Hao

Reputation: 1137

I have encounter this issue recently and the reason caused by our Azure account having payment issue. Then it seems like VS2017 is trying to connect Azure Function App every times to verify availability through our problem account instead of using publishing profile.

The solution is simple, remove all the azure accounts(File> Account Setting), then click again publish(assume you have already insert your downloaded publishing profile), then you are good to go.

Upvotes: 1

Michael Gordon
Michael Gordon

Reputation: 131

I think the problem is that when you install the visual studio update, it changes the runtime version, and when you try to deploy it fails because of this.

I ran into this problem myself and I found that when I manually created a new publishing profile through visual studio, it would then give me a prompt which advised that "The remote Azure Functions runtime version needs to be updated", click on yes and it will update the runtime and deploy.

I wrote about this on my blog here: https://cosmicdistortion.wordpress.com/2018/09/06/azure-functions-web-deployment-fails-after-visual-studio-update-to-version-15-8/

Upvotes: 4

Gaander
Gaander

Reputation: 81

After fiddling around with the deployment Settings in Azure, I think I managed to solve this issue. I am not sure what did the trick exactly, but I could reproduce it for all my pending deployments. Also now I have my publishing log in the output window back without changing any Option in VS.

So, if anyone experiences the same problem, try this - something in the list triggered it to work again:

  1. Go into the Azure Portal -> Function Apps -> Select your Function -> Open the "Platform features" Tab
  2. Under "Code Depolyment" choose "Deployement credentials".
  3. Change the credentials to anything you like and save.
  4. Redownload the publish profile from the "Overview" Tab.
  5. Import the Publish Profile and publish from VS.
  6. If it still doesn't work
  7. Again go into the Portal -> "Overall" Tab.
  8. Press "Reset publish credentials"
  9. In VS create a new publish profile with "Run from ZIP" cheked. And try to publish. Then revert to the old Web Deploy Method and try to publish again.
  10. If again it still doesn't work
  11. Redownload the publish profile from the "Overview" Tab.
  12. Import the Publish Profile and publish from VS.

I have no idea, why this works, as I thought the "Code Deploy" Credentials are purely optional and I never needed to change any of the settings in the past to publish a function, simply download the profile and done. So "something" has changed maybe? Maybe I did something wrong? I really can't tell.

Upvotes: 2

Related Questions