Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.32k stars 433 forks source link

Unable to debug Azure Functions #1797

Open jabbera opened 4 years ago

jabbera commented 4 years ago

I'm unable to debug azure functions in vs 2019 (5 preview 2 and .4). Every time I try to start in the debugger the following message shows up:

image

I've reset all settings, repaired VS, and deleted the AzureFunctionsTools, and .templateengine folder. I can still debug .net core console apps.

PLEASE HELP.

I'm not the only one running into this issue:

https://developercommunity.visualstudio.com/content/problem/896770/fatal-error-when-debugging-an-azure-function-using.html

anthonychu commented 4 years ago

@vijayrkn Is this something you've seen? Looks like a few people have run into this. Thanks.

fabiocav commented 4 years ago

@soninaren , FYI

soninaren commented 4 years ago

@jabbera Can you add a repro steps to the issue? A sample project that could repro's this issue would help a lot.

jabbera commented 4 years ago

@soninaren sigh. The saga of this is not pretty. The failure mode is even worse. I will do my best to tell you what happened. Happy to answer any questions or talk on the phone.

The tools cli download was taking over an hour on on our network. (More on this later) Visual studio would NOT wait the full hour. It would hang for about 1-2 minutes then return the unhelpful error above. It did this EVERY time I tried to debug. This symptom has been reported before w.r.t. the AzureFunctionTools download. Luckily I found an issue that pointed me in the right direction. I was able to manually resolve the issue by copying the: C:\Users\\AppData\Local\AzureFunctionsTools from a VM off our network to my machine locally. Then everything started working fine. Clearly this message is a result of not having the tools. I would really expect Visual Studio to either wait for the download to finish and if it did fail, fail with a message that the tools could not be downloaded successfully along with some manual steps to resolve the issue.

The reason why the download was so slow is our edge firewall (Palo Alto) was decrypting the traffic and sending it to their wildfire analysis service. After I had ITSEC whitelist your CDN hostname all started working well on network.

While I'm happy I got everything working I would really expect VS to fail in a manner that at least gave you some idea what was wrong. I could not find a single log file anywhere that pointed me to what the issue is. If it wasn't for the fact that I had to wait 1-2 minutes to attempt to download the tools every time I attempted to start a debug session I don't think I ever would have figured out what was going on.

antogh commented 4 years ago

I have the same issue. I have re-installed AzureFunctionsTools 3 times, updated vs2019 and windows 10 pro to the latest available today. Nothing works. when I try to debug a simple template hello world az function v3 with vs2019 it tries to download the tools and then fails with the fatal error (see scr scap at the bottom)

It seems that VS2019 is not aware that the tools for V3 are installed, but what can I do more than wasting hours reinstalling the tools over and over? I don't have another VM where I can copy the tools from as the OP did to solve the problem.

Function V2 works but I want to use the latest, V3.

It's a super frustrating experience, many devs have it (just search and you will see) and since many months. What's really disappointing is that all the components are Microsoft made, yet they can't work together. It should work right out of the box. Please fix ASAP, Azure Functions is probably the most important Azure service, you can't ship tools that behave so bad, it's damaging Microsoft business and reputation. And sorry for the rant, but I just come from another frustration of wasted days with AD B2C solved in the end by giving up and using Auth0 instead.

vs2019 err debug az func

vs2019 err debug az func2

Jerac102 commented 4 years ago

Hi, i have the same problem. After a day of searching i installed .Net Core 3.1 SDK and updated my Visual Studio 2019 to v.16.5.4. I have also installed among others:

Microsoft Visual Studio Enterprise 2019 Version 16.5.4 VisualStudio.16.Release/16.5.4+30011.22 Microsoft .NET Framework Version 4.8.03752

ASP.NET and Web Tools 2019 16.5.236.49856 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.5.236.49856 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.5.236.49856 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.4.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.5.236.49856 Azure Functions and Web Jobs Tools

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30207.1

anthonychu commented 4 years ago

@soninaren Have you had a chance to see what might be happening here? Thanks.