Azure / Azure/azure-functions-core-tools

PDB symbol path don't add up when debugging (attaching) Azure Functions inside a container

Open
#2,784 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

It looks like the paths don't match when you attach to a running container hosting Azure Functions.

Steps to reproduce:
1. Follow steps 1 to 3 in this guide: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=isolated-process%2Cbash%2Cazure-cli&pivots=programming-language-csharp
2. Put a break-point in VS Code in the Test Function
3. Attach to the container through VS Code (see luanch.json below)
The following error occurs:

![image](https://user-images.githubusercontent.com/2158013/138837522-54041fa9-1300-4d52-b807-3943e54ba1f9.png)

The problem seems to be in [Dockerfile.dotnet](https://github.com/Azure/azure-functions-core-tools/blob/dev/src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnet) where it copies to source `COPY . /src/dotnet-function-app`. Changing it to `COPY . /src` seems to fix the issue. (I don't know if it will have other implications)

_luanch.json_
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Docker .NET Core Attach",
"type": "docker",
"request": "attach",
"platform": "netCore",
"sourceFileMap": {
"/src": "${workspaceFolder}/src/scanner-api"
}
}
]
}
```

Contributor guide

Open the contributing guide

Research direction

Start with src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnet and compare its COPY destination with the /src mapping in the launch.json example. Reproduce the container attach workflow from the linked Azure Functions guide, then verify whether the proposed path alignment restores breakpoint and PDB resolution without affecting other image behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, docker
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.