Azure Functions for GoのGo紹介

>100 Views

August 01, 26

スライド概要

2026年8月1日(土)に広島県広島市で開催された「第10回 Azure Travelers 勉強会 広島の旅」での私の登壇資料「Azure Functions for GoのGo紹介」です。2026年6月2日にプレビュー版ながら対応言語となったGo版について紹介させて頂きました。

profile-image

主にICTイベントでの発表資料を公開しています。

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

ダウンロード

関連スライド

各ページのテキスト
1.

Azure Functions for Goの紹介 第10回 Azure Travelers 勉強会 広島の旅 1 August 2026 Ryuji Iwata Okayama, Japan

2.

Ryuji Iwata X (Twitter) : @qt_luigi Portfolio : sites.google.com/view/ryuji-iwata-portfolio

3.

Azure Functions Azure上で関数を動作させる環境。最近ではMCPバインド拡張機能が実装。 対応言語 : C#, Java, JavaScript, PowerShell, Python, TypeScript Microsoft | Azure 詳細はこちら 製品 ∨ ソリューション ∨ 表示数を増やす ∨ 検索 🔍 学ぶ サポート 営業に問い合わせる Azure の利用を開始する サインイン Azure Functions エンド ツー エンドの開発環境で、イベントドリブンのサーバーレス コード を実行します。 好みの言語で サーバーレス アプリとエージェント を設計し、ビジネス ロジックに集中できます。 Azure の使用を開始する Azure Functions の使用を開始する Azure Functions 概要 ユーザ ケース セキュリティ 価格 関連製品 顧客事例 リソース よくあるご質問 次のステップ Azure の使用を開始する azure.microsoft.com/ja-jp/products/functions

4.

Azure Functions Custom Handler Go, Rust, Denoなど非対応言語の関数をコンテナーにホストして動作させる仕組み。 最近ではMCP SDKで作成されたMCPサーバーをデプロイする環境に用いられている。 CUSTOM HANDLER WEB SERVER FUNCTION CODE REQUEST PAYLOAD TRIGGER TRIGGER / INPUT BINDING PAYLOAD FUNCTIONS HOST RESPONSE PAYLOAD OUTPUT BINDING PAYLOAD TARGET * NOT ALL FUNCTIONS HAVE OUTPUTS learn.microsoft.com/ja-jp/azure/azure-functions/functions-custom-handlers#overview

5.

サポート終了情報 現在のバージョンは v4 です。 2022年12月13日 v2, v3 延長サポート終了 2026年9月14日 v1 サポート終了 (C#, JavaScript) 2026年9月30日 Linux 従量課金プラン v3 ランタイム停止 • v4 に移行。 2028年9月30日 Linux 従量課金プラン サポート終了 • Flex 従量課金プランに移行。

6.

Announcing Go support in Azure Functions (Preview) 2026年6月2-3日のMicrosoft Build 2026にて、プレビュー版ながらGoが対応言語に。 Tech Community Community Hubs Products ∨ Topics ∨ Blogs ∨ Events ∨ Skills Hub ∨ Community ∨ 検索 Register Sign In HTTP GO APPS ON AZURE BLOG 5 MIN READ Announcing Go support in Azure Functions (Preview) AnthonyChu MICROSOFT Jun 02, 2026 Write Azure Functions in Go using a first-class serverless programming model We're excited to announce that Azure Functions now supports Go as a first-class language, available today in public preview on the Flex Consumption plan. Go developers can now build event-driven, serverless applications using idiomatic Go, the standard toolchain they already love, and the full breadth of Azure Functions triggers, bindings, and operational capabilities. TL;DR: Write Functions in Go using a new code-first programming model and SDK (azure-functions-golang-worker). Use triggers across HTTP, Timer, Service Bus, Event Hubs, Event Grid, Cosmos DB, and Blob Storage. techcommunity.microsoft.com/blog/appsonazureblog/announcing-go-support-in-azure-functions-preview/4523801

7.

Azure/azure-functions-golang-worker Goの関数を動作させるパッケージ。公開Goに一時アクセスできなくなりアセス。 Platform ∨ Solutions ∨ Resources ∨ Open Source ∨ Enterprise ∨ Pricing 検索 or jump to... Sign in Sign up Azure / azure-functions-golang-worker Public Notifications Fork 4 Star 8 Code Issues 3 Pull requests 3 Actions Projects Models Security and quality Insights Files main Go to file .vscode eng middleware otelcollector proxy samples sdk tests triggers worker .gitattributes .gitignore CODEOWNERS CODE_OF_CONDUCT.md CodeQL.yml LICENSE README.md SECURITY.md azure-functions-golang-worker / README.md harshivcodes Merge pull request #42 from Azure/hakkara/sqlTrigger f67b828 last month History Preview Code Blame 334 Lines (237 loc) 16 KB Raw Azure Functions Go Worker (Preview) go report retired reference Public preview. The features described here are available for preview use and may change before general availability. The azure-functions-golang-worker repository provides the SDK and worker implementation to run Go (Golang) applications natively on Azure Functions. This allows developers to write serverless applications using familiar idiomatic Go structures, such as standard net/http handlers and structured types, while deeply integrating with Azure Function's bindings and trigger ecosystem. Features • Native Go Feel: Use standard http.ResponseWriter and http.Request for HTTP APIs. • Worker-driven indexing: No need to manually author function.json files. Define your triggers and bindings directly in Go code using a functional options API. • First-Class Performance: Runs in an out-of-process model utilizing gRPC for highly performant bidirectional communication with the Azure Functions host. • Rich Bindings: Built-in reflection to map Azure bindings (like blobs, queues, CosmosDB) into strictly typed Go pointers and structs. github.com/Azure/azure-functions-golang-worker/blob/main/README.md

8.

for Goの特徴 プレビュー版ということで • Flex 従量課金プランのみで動作。 • Durable Functions には未対応。 • MCPハンドル機能拡張には未対応。 対応言語 (first class) 化されたことで • 内部の通信は gRPC で統合。 • 関数エンドポイントは設定ファイル (function.json) なしで。

9.

Goで開発する際のツール Go (v1.24 以降) go.dev/ Azure Functions Core Tool (v4.12 以降) • Azure Functions CLIとしてv5がプレビュー版で公開中。 github.com/Azure/azure-functions-core-tools Azure CLI (v2.87 以降) • v2.85.0からmacOS版も単体でダウンロード可能に。 github.com/Azure/azure-cli

10.

コード比較 : import句 Custom Handler package main import ( "io/ioutil" "log" "net/http" "os" ) for Go package main import ( "fmt" "net/http" "github.com/azure/azure-functions-golang-worker/sdk" "github.com/azure/azure-functions-golang-worker/worker" )

11.
[beta]
コード比較 : hello()関数
Custom Handler
func hello(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
if r.Method == "GET" {
w.Write([]byte("Hello, world!"))
} else {
body, _ := ioutil.ReadAll(r.Body)
w.Write(body)
}
}
for Go
func hello(w http.ResponseWriter, r *http.Request) {
name := r.URL.Query().Get("name")
if name == "" {
name = "world"
}
fmt.Fprintf(w, "Hello, %s!", name)
}
12.
[beta]
コード比較 : main()関数
Custom Handler
func main() {
port, exists := os.LookupEnv("FUNCTIONS_CUSTOMHANDLER_PORT")
if !exists {
port = "8080"
}
mux := http.NewServeMux()
mux.HandleFunc("/api/hello", hello)
log.Fatal(http.ListenAndServe(":"+port, mux))
}
for Go
func main() {
app := sdk.FunctionApp()
app.HTTP("hello", hello,
sdk.WithMethods("GET", "POST"),
sdk.WithAuth("anonymous"),
)
worker.Start(app)
}
13.

Thank you Ryuji Iwata Okayama, Japan @qt_luigi