简体   繁体   中英

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:

  • Cleaned the solution; deleted %temp%; deleted the publishing profile; reset the publish credentials in Azure; build it all again and import a newly generated publish profile: Same Error
  • Uninstalled VS2017; Cleaned all remains; Reinstalled VS2017: Same Error
  • Checked our Firewall, if anything gets blocked and even tried an exception for my workstation to allow all traffic: Same Error
  • Tried publishing from a physically different Network: Same Error
  • Stop the Function in the azure portal prior to publishing: Same Error
  • In the azure portal: Delete an create a new and empty azure function to publish to: Same Error
  • In the azure portal: Set the 'Function app edit mode' to Read/Write: Same Error
  • Tried to hit the functions Endpoint-URL in the browser. No Problem.
  • Tried to publish from a colleagues workstation with Visual Studio 2017 Pro Version 15.7.1: Works fine - as used to

My Questions:

  • Am I missing something? Is there anything else I can try except installing an older version of Visual Studio, which would be my next step.
  • Could this be a bug in the latest Azure Tools or even Visual Studio?
  • Why is my Output window not giving me any information to address the failing publishing attempt? Am I missing some new option to activate this again?

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

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/

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.

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!

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.

Simply add to the App Service Settings:

FUNCTIONS_EXTENSION_VERSION = ~1 

Both remote and locally.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM