Attach to debugger for Azure Functions from Rider on Mac
Asked Answered
J

2

6

Just wondering if anyone has managed to attach and debug an Azure Functions app using JetBrains Rider?

There only seems to be 2 debug options for Azure Functions

--debug VS 
--debug VsCode

Not sure if Rider can attach to these, I can't find much on this. So if anyone else has succeeded please let me know how/if it can be done.

Thanks.

Jedjedd answered 26/9, 2018 at 15:9 Comment(0)
M
3

No, this is not possible to date (4. Oct. 2018): According to the Rider online bug report (This is not implemented yet, please feel free to vote for https://youtrack.jetbrains.com/issue/RIDER-1256) this is not solved, yet.

Malady answered 4/10, 2018 at 17:53 Comment(0)
J
3

The above issue has now been resolved, however it still does not support Azure Functions.

However I did find this, please note this appears to be windows only, not Mac.

https://github.com/JetBrains/azure-tools-for-intellij/issues/78#issuecomment-439313762

Install the Azure functions command line tools using NPM (https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local)

Add a file Properties/launchSettings.json, with the following contents (tailored to your project):

{
  "profiles": {
    "functions": {
      "commandName": "Executable",
      "executablePath": "dotnet",
      "commandLineArgs": "%APPDATA%\\npm\\node_modules\\azure-functions-core-tools\\bin\\func.dll host start --port 7071 --pause-on-error",
      "environmentVariables": {
        "AZURE_FUNCTIONS_ENVIRONMENT": "Development",
        "AzureWebJobsStorage": "UseDevelopmentStorage=true"
      }
    }
  }
}

Run the launch profile, and wait for the functions host to say it is running In Rider, attach to the process using Run | Attach to Process.... Find the process that is running dotnet ... func.dll:

Jedjedd answered 7/12, 2018 at 15:30 Comment(1)
thanks Lenny, this works perfectly on mac as well (just make sure the path to the dll is correct)Perse

© 2022 - 2024 — McMap. All rights reserved.