Skip to content

Build and package for the platform image

Azure Functions runs Go applications on a platform-provided Ubuntu image. You deploy your application; Azure maintains the Functions host and container image.

You don't need a Dockerfile or container registry.

Note

Native Go hosting is generally available on the Flex Consumption plan and in preview on Elastic Premium and Dedicated Linux App Service plans.

Platform image

Hosting plan Status Platform runtime Runtime version Base OS Architecture Image pattern
Flex Consumption Generally available native 1.0 Ubuntu Noble Linux x64 mcr.microsoft.com/azure-functions/noble/flexconsumption:<HOST_VERSION>-native1.0
Elastic Premium Preview native 1.0 Ubuntu Resolute Linux x64 mcr.microsoft.com/azure-functions/resolute/linuxdedicated:<HOST_VERSION>-native1.0-appservice
Dedicated (Linux App Service plan) Preview native 1.0 Ubuntu Resolute Linux x64 mcr.microsoft.com/azure-functions/resolute/linuxdedicated:<HOST_VERSION>-native1.0-appservice

Azure selects and updates the host image for every supported plan; you don't select or deploy it.

Build and package

Build with Core Tools

From the function project root, create a deployment package:

func pack --output functionapp.zip

Core Tools builds the Go application for Linux x64 and packages it with the required Functions files.

Package a prebuilt executable

Important

The executable must be named app.

To package an executable that you built yourself:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app .
func pack --no-build --output functionapp.zip

Core Tools marks app as executable in the ZIP metadata.

To create the ZIP directly on Linux:

FILES=(app host.json)
[ -f worker.config.json ] && FILES+=(worker.config.json)
zip -r functionapp.zip "${FILES[@]}"

See Deployment for supported deployment methods.