question

AmolTidke-4067 avatar image
0 Votes"
AmolTidke-4067 asked ·

How to remote debug an azure function that we trigger from console app

Hi All,

I have created an azure function to upload a file from local to SharePoint online site.

I created one console application that takes input file from local path and get its content too. Then I am calling the azure function from this console application(with passing file data as parameter) and this azure function creating client context to connect to SP online site and upload this file to library.

I am using certificate authentication to connect to SP online site.

It works fine when I debug this in local(file uploaded to library) but didn't work for remote. I try to debug this for remote but couldn't hit break points.

Any help will be much appreciated.

Thanks & Regards,
Amol Tidke

office-sharepoint-onlineazure-functions
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AmolTidke-4067 Thank you for your question. We will review and update at the earliest.

0 Votes 0 ·

Hi @AmolTidke-4067 ,

Is there any update ? Did you resolve the issue in the question ?

Thanks
Best Regards

0 Votes 0 ·

1 Answer

Jerryzy-MSFT avatar image
0 Votes"
Jerryzy-MSFT answered ·

Hi @AmolTidke-4067 ,

You can use Visual Studio Debug->"Attach to Process" for debugging the function remotly, checkout the blog for details:

Remote debug your azure function app v2 in Visual Studio 2019

And for the Azure Function, also need to enable remote debugging:

74224-snipaste-2021-03-04-16-14-57.png


Thanks
Best Regards


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the reply Jerry.

Please find my case below:

I am able to attach the debugger and breakpoints were also hit when I run url in browser but I am facing issue while hitting breakpoint from console application. As in my case I am calling Azure function from console applications and I am unable to hit breakpoint though I run the console exe.

Please help.

Thanks,
Amol

0 Votes 0 ·

Suggest to create a .NET Web Application to consume the Azure function instead of Cosnole application:

Create And Consume Azure Function From ASP.NET Core



And if the breakpoint hits in browser url, try to trace the request using browser tool to see if there is some request header/body needed.

1 Vote 1 ·