Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging x64 Azure Functions in Visual Studio

I'm writing a C# Azure function via Visual Studio. This function is triggered through blog storage, and the blob is processed using an x64 C++ DLL.

The issue is that the default Azure functions tooling installed with visual studio only has an x86 version of the functions exe (func.exe).

I see at this URL, there are now x64 builds: https://github.com/Azure/azure-functions-core-tools/releases

The problem is, by default, Visual Studio is picking version 1.2.0 of the tools on my machine (C:\Users\acardy\AppData\Local\AzureFunctionsTools\Releases\1.2.0), and I don't see a 1.2.0 x64 release at the URL.

Is there any way to get Visual Studio to choose a different version that I could then patch with an x64 build?

I'm currently running Visual Studio version 15.7.1.

Thanks.

like image 800
Andy Avatar asked Jun 14 '18 08:06

Andy


People also ask

How do I debug Azure function app in Visual Studio?

In Visual Studio Code, press F5 to launch the debugger and attach to the Azure Functions host. You could also use the Debug > Start Debugging menu command. Output from the Functions Core tools appears in the Terminal panel.

How do I debug Azure function?

You can easily accomplish this on the Azure Portal: On the Azure Portal, access your Azure Function App, from the left context menu select the option Functions present in the Functions section. On the Functions page, select the Function you want to debug.

How do I run Azure function in Visual Studio?

From the Visual Studio menu, select File > New > Project. In Create a new project, enter functions in the search box, choose the Azure Functions template, and then select Next. In Configure your new project, enter a Project name for your project, and then select Create.


1 Answers

1.2.0 (aka cli 1.0.13) download links have not been published yet in the release note you mentioned. And VS downloads x86 cli version for v1 functions by default.

So you can download a previous version x64 cli manually and use it to debug. See 1.0.12.

Note: Visit cli release note to download latest version(1.x for v1 functions, 2.x for v2).

After downloading this cli, right click your project->Properties, do debug configuration below.

Launch: Executable
Executable: yourclifolderpath\1.0.12-x64\func.exe
Application Arguments: host start
Working Directory: $(TargetDir)

enter image description here

like image 151
Jerry Liu Avatar answered Sep 16 '22 12:09

Jerry Liu