Skip to content

Unable to debug dotnet-isolated Azure Function with specific logging configuration #595

@LarsBauer

Description

@LarsBauer

Hi,
I cannot debug my dotnet-isolated Azure Function (.NET 6) locally. After successful build the process runs a long time with the status

Waiting for Azure Functions host to start...

... and then ends with the following error message.

Azure Functions host did not return isolated worker process id. Could not attach the debugger. Check the process output for more information.

When I start the debugging from terminal I am able to attach to the process in Rider without a problem. So I guess this issue is somehow related to the tooling.

Here is my environment:
Windows 11
JetBrains Rider 2022.1.1
Azure Toolkit for Rider 3.50.0.1413-2022.1

Strange observation I made when trying to narrow down the problem. As soon as I configure any log level with a higher severity than Information for the host in my host.json the debugging fails with the above mentioned error. When I set the value to Information or any other lower severity the debugging is working fine. At this point I am not sure whether this is the root cause but it is definitely strange...

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,
                "excludedTypes": "Request"
            }
        },
        "logLevel": {
            "default": "Warning",
            "Host": "Error", <-- this breaks the debugging
            "Function": "Information"
        }
    }
}

If you need any more information I am glad to provide it. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions