Azure / Azure/azure-functions-host

vs17 attach debugger for v2

Open
#3,810 8 comments 2 reactions 0 assignees View on GitHub
needs-investigation
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

vs17 | cloud explorer | subscrtion | app services | azure function v2.0.12180.0 / .net core 2.1.0 with nuget microsoft.net.sdk.functions (1.0.6 upgraded to 1.0.24) | attach debugger doesn't throw any errors but breakpoints in source code say "The breakpoint will not currently be hit. No symbols have been loaded for this document." and as you might expect it doesn't stop on breakpoints.

I'm publishing a debug | anycpu output and in vs17 i have debug | options | "Enable Just My Code" and "Require source files to exactly match the original version" disabled, am using publishing profile that doesn't have run from package file (recommended) [ / application settings WEBSITE_RUN_FROM_PACKAGE Remote = 1 ] set and file publish options | remove additional files at destination enabled.

If i do the same debug | anycpu publish and attach debugger steps for an azure function v1.0.12154.0 / .net framework 4.6.1 with nuget microsoft.net.sdk.functions (1.0.6 not upgraded to 1.0.24) breakpoints light up and things work as expected.

The reason this functionality is important is because once the long awaited functions v2 support for authentication/authorization releases this week, see [issue 33](https://github.com/Azure/azure-functions-host/issues/33), its pretty much going to require one moving to attach debugger story for all debugging as localhost debugging presumably isn't going to be injecting the express/easyauth request processing necessary for ClaimsPrincipal injected context object to be populated.

#### Investigative information

Please provide the following:

- Timestamp: 11/25/2018 7:40pm
- Function App version (1.0 or 2.0): 2.0
- Function App name: azfndn1
- Function name(s) (as appropriate): Function1, Function2, etc.
- Invocation ID:
- Region: Central US

#### Repro steps

Provide the steps required to reproduce the problem:

1. git clone https://github.com/myusrn/lnsexploration
2. vs17 | open AzFuncApp1/AzFuncApp1.csproj
3. create publish profile for debug | any and publish
4. set breakpoints in Function1.cs and Function2.cs
5. cloud explorer | azure subscription | app services | AzFuncApp1 setup | attach debugger

#### Expected behavior

After I perform step 5 I expect breakpoints in code to light up as enabled and execution of https://.azurewebsites.net/Function1 or /Function2 to cause me to stop on vs17 break points.

#### Actual behavior

I do not stop on breakpoints. And breakpoints show warning icon stating ""

#### Known workarounds

Provide a description of any known workarounds.

Revert to a v1 deployment which is highly undesirable at this point.

#### Related information

i'm using clean current install of win10 october 2018 update / 17763.134 and vs17 / 15.9.2

Contributor guide

Open the contributing guide

Research direction

Reproduce the Azure Functions v2 issue from the stated clone and publish steps, opening AzFuncApp1/AzFuncApp1.csproj and setting breakpoints in Function1.cs and Function2.cs. Start by comparing the v2 attach-debugger behavior and symbol loading with the working v1 case; done means attached debugging reaches those breakpoints when the deployed Function1 or Function2 endpoint is invoked.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.