Add Go Azure Functions framework service support#8599
Conversation
Adds a new 'go' service language for Azure Functions, enabling `azd up` for Go-based Function Apps on Flex Consumption. This follows the pattern of existing language framework services (Python, Node, Java, .NET). Changes: - Go CLI tool wrapper (pkg/tools/golang/) with min version Go 1.24 - Framework service (pkg/project/framework_service_go.go): Restore, Build (cross-compile GOOS=linux GOARCH=amd64), Package (app binary + host.json) - IoC container registration in cmd/container.go - Schema updates for azure.yaml (v1.0 and alpha) - Function app target: Go returns false for remote build - Fix rzip to preserve Unix file permissions in zip archives - Unit tests for all framework service lifecycle methods - Functional deploy test (Test_CLI_Up_Down_GoFuncApp) with Flex Consumption infrastructure (runtime: go 1.0, managed identity, blob deploy) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
POC: Go Azure Functions Support for azd core
Closes #8307
What this adds
A new
goservice language for Azure Functions, enablingazd upfor Go-based Function Apps on Flex Consumption. This follows the pattern of existing language framework services (Python, Node, Java, .NET).Components
pkg/tools/golang/golang.goExternalToolinterface —CheckInstalled()with min version Go 1.24,Build(),ModDownload()pkg/project/framework_service_go.goFrameworkService— Restore (go mod download), Build (cross-compileGOOS=linux GOARCH=amd64 CGO_ENABLED=0), Package (binary + host.json)cmd/container.goschemas/v1.0/azure.yaml.json,schemas/alpha/azure.yaml.jsongoto language enumpkg/project/service_target_functionapp.gofalsefor remote buildpkg/rzip/rzip.gopkg/project/framework_service_go_test.gotest/functional/up_test.goTest_CLI_Up_Down_GoFuncApp— provision → deploy → health probe → cleanuptest/functional/testdata/samples/gofuncapp/Deployment model
functionAppConfig.runtime: { name: 'go', version: '1.0' }worker.config.json— deployment package is justapp+host.jsonAzureWebJobsStorage__accountName)SystemAssignedIdentityKey learnings from prototyping
azure-functions-golang-workerSDKgo(notcustom) on Flex ConsumptionFUNCTIONS_WORKER_RUNTIMEapp setting is not needed (and is rejected by Flex Consumption)rzip.gowhere Unix file modes were not preservedTODO before merging