title: Azure functions v3 attach debugger to docker container in local started with docker-compose (dotnet)
body: <p>I`m trying to incorporate the azure function (c#) in the already existing docker-compose file. By reverse engineering from how visual studio starting container and build image, I have ended up with something like this:</p>
  <pre><code>version: '3.4'
  services:
      azure.storage.emulator:
          image: &quot;mcr.microsoft.com/azure-storage/azurite:latest&quot;        
          container_name: azure.storage.emulator
          ports:
              - 10000:10000
              - 10001:10001
          volumes: 
              - azurite_data:/data mcr.microsoft.com/azure-storage/azurite
          networks: 
              - internal_network 
      azure.function:
          build:
              context: .
              dockerfile: FunctionApp/Dockerfile
          volumes:
              - 'C:\Users\MyComputer\vsdbg\vs2017u5:/remote_debugger:rw'
              - 'C:\Users\MyComputer\Desktop\docker infrastructure\TestFunction\FunctionApp\FunctionApp:/home/site/wwwroot'
              - 'C:\Users\MyComputer\Desktop\docker infrastructure\TestFunction\FunctionApp:/src/'
              - 'C:\Users\MyComputer\AppData\Local\AzureFunctionsTools\Containers_2109029\Releases\3.20.0\linuxCLI:/functions_debugging_cli:ro'
              - 'C:\Users\MyComputer\.nuget\packages\:/root/.nuget/fallbackpackages2'
              - 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder:/root/.nuget/fallbackpackages'    
          ports:
              - 8081:80
          container_name: Azure.Function
          networks: 
              - internal_network
          entrypoint:
              - tail
          command:
              - -f
              - /dev/null    
          depends_on:
              - azure.storage.emulator
          environment:
              - DOTNET_USE_POLLING_FILE_WATCHER=1
              - ASPNETCORE_ENVIRONMENT=Development
              - ASPNETCORE_URLS=http://*:10123
              - NUGET_PACKAGES=/root/.nuget/fallbackpackages2
              - NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages;/root/.nuget/fallbackpackages2
              - WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT=1,
              - FUNCTIONS_WORKER_RUNTIME=dotnet
              - AzureWebJobsStorage=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azure.storage.emulator:10000/devstoreaccount1;QueueEndpoint=http://azure.storage.emulator:10001/devstoreaccount1;
  
  # NETWORKS
  networks:
    internal_network:
  
  # VOLUMES
  volumes:
    azurite_data:
  </code></pre>
  <p>Hitting localhost/8081 I can verify that function is running, but I can not confirm that it does its job.</p>
  <p><strong>Another big problem</strong> is that when I attach to function with a remote debugger I can not debug it, because symbols are not loaded.</p>
  <p>I would really appreciate it if anybody can help me with running and debugging the Azure function started through a docker-compose file.
  There are several articles on the web, but I haven't had luck with the steps described in them.</p>
  <p>my docker file looks like this:</p>
  <pre><code>#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
  
  FROM mcr.microsoft.com/azure-functions/dotnet:3.0-appservice AS base
  WORKDIR /home/site/wwwroot
  EXPOSE 80
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
  WORKDIR /src
  COPY [&quot;FunctionApp/FunctionApp.csproj&quot;, &quot;FunctionApp/&quot;]
  RUN dotnet restore &quot;FunctionApp/FunctionApp.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/FunctionApp&quot;
  RUN dotnet build &quot;FunctionApp.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;FunctionApp.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /home/site/wwwroot
  COPY --from=publish /app/publish .
  ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
      AzureFunctionsJobHost__Logging__Console__IsEnabled=true
  </code></pre>
  <p><strong>To summarize, I`m asking for help with starting and debugging azure functions v3 started by docker-compose</strong></p>