Function App HTTP/2 사용 설정 점검

Function App의 HTTP/2 필요성과 클라이언트 호환성을 검토하고 HTTPS 보호는 별도로 확인하세요.

설명

함수 호출에 HTTP/2의 다중화가 필요하면 Function App에서 site_config.http2_enabled = true로 설정하세요. 실제 사용할 HTTP 버전은 클라이언트와 협상합니다.

잠재적 영향

HTTP/2가 필요한 호출이 HTTP/1.1로 연결되면 기대한 전송 효율이나 운영 기준을 충족하지 못할 수 있습니다. 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
  }
}

참조