GOLANG: No stacks found for "custom" on Azure Functions v4

Ken Just-Ken 10 Reputation points
2025-03-07T22:58:42.3733333+00:00

Following the instructions on learn.microsoft.com for creating an Azure Function written in Golang, the instructions fail here: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-other?tabs=go%2Cmacos#create-the-function-app-in-azure

...at step 3/3 with the message "No stacks found for "custom" on Azure Functions v4".

This appears to be in reference to the value in local.settings.json for "FUNCTIONS_WORKER_RUNTIME": "custom"

...but changing that to other values did not result in success or a different error message.

Is this an issue with Azure Functions? Or is it an issue with Azure Functions Core Tools?

Please provide a work-around OR document that Golang is not supported.

Thanks!

Ken

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,930 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Pravallika Kothaveeranna Gari 955 Reputation points Microsoft External Staff Moderator
    2025-03-13T10:40:26.45+00:00

    Hi @Ken Just-Ken,

    Follow below steps to create Function App with Custom as runtime stack:

    Prerequisites:

    • Upgrade/Downgrade Visual Studio Code version to 1.98.1. I have tested the same and it worked.
    • Azure Function Core tools version: 4.0.6821.
    • go version: go1.23.6 windows/amd64.

    Steps to create function app with custom handler:

    • Open Visual Studio Code, Click on Azure=> Function icon=>Select Create function App in Azure.
    • Provide a unique function App name.
    • Select Function runtime: Custom handler and Function extension version: ~4.

    enter image description here

    • Select required location.
    • This creates all the resources required to run GO custom handler function in Azure.

    enter image description here

    Make sure the Functions Runtime is set to custom in App Settings under Function App=>Settings=>Environment Variables.

    enter image description here

    Run below commands before deploying the function:

    
    set GOOS=linux
    
    set GOARCH=amd64
    
    go build handler.go
    
    
    • Add handler.exe in host.json:

    host.json:

    
    {
    
      "version": "2.0",
    
      "logging": {
    
        "applicationInsights": {
    
          "samplingSettings": {
    
            "isEnabled": true,
    
            "excludedTypes": "Request"
    
          }
    
        }
    
      },
    
      "extensionBundle": {
    
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
    
        "version": "[4.*, 5.0.0)"
    
      },
    
     "customHandler": {
    
      "description": {
    
        "defaultExecutablePath": "handler.exe",
    
        "workingDirectory": "",
    
        "arguments": []
    
      },
    
      "enableForwardingHttpRequest": true
    
    }
    
    }
    
    
    • Deploy GO custom handler to Azure function app.

    enter image description here

    • Run the deployed function in Portal:

    enter image description here

    Update:

    Ken Just-Ken Thank you for your patience and for sharing your feedback on the Q&A community platform. I appreciate you sharing your findings! Your contribution is valuable and can help others in the community facing similar challenges.

    As per the Microsoft Q&A community policy, "The question author cannot accept their own answer. They can only accept answers by others"

    I’m reposting your workaround as solution here so you can mark it as accepted:

    As an alternative, you can create function app with custom handler by selecting Create Function app in Azure(Advanced) in visual studio code:

    User's image

    Provide unique name for function app and select subscription, pricing plan and custom handler as the runtime stack:User's image

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.  

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.