説明
関数の呼び出しに HTTP/2 の多重化が必要な場合は、site_config.http2_enabled = true にします。実際に使う HTTP バージョンはクライアントとのネゴシエーションで決まります。
想定される影響
HTTP/1.1 で接続した場合、HTTP/2 に期待した転送効率や運用要件を満たせないことがあります。HTTP/1.1 でも HTTPS は利用できます。
対処方法
サポート対象のクライアントで関数を呼び出し、実際に使われたプロトコルを確認してください。HTTPS の強制、最小 TLS バージョン、呼び出し元の認証も別途確認します。クライアント証明書を使う場合は、HTTP/2 が対応しない TLS 再ネゴシエーションを必要とする設定を避けてください。
例
AzureRM 3.x の azurerm_function_app の例は必須のストレージ設定を省略しています。http2_enabled とともに指定する .NET やデプロイの設定は例の環境のものです。実際のデプロイにはサポート対象のランタイムを使用してください。
変更前
hcl
resource "azurerm_function_app" "example" {
name = "test-azure-functions"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}
変更後
hcl
resource "azurerm_function_app" "example" {
name = "test-azure-functions"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config {
dotnet_framework_version = "v4.0"
scm_type = "LocalGit"
http2_enabled = true
}
}