1

In a Function App in the azure portal, under the configuration settings there is a an option regarding HTTP 2.0

Options are

  • Off
  • On
  • gRPC only

enter image description here

This help page also mentions the environment variable HTTP20_ONLY_PORT

I did some experiementation by creating a isolated process function, which then opened another port for gRPC communications in the hope the above settings may, as it says, forward HTTP2 traffic to the HTTP20_ONLY_PORT. But after a day of experimentation I came up empty handed.

Anyone know what this setting actually does under the hood ?

1 Answers1

0

I found a small demo script which creates a function app with http2 enabled so you are able to continue testing yourself. Script is not tested by myself

#!/bin/bash

deploy_region="westeurope"
deploy_group="http2-func-group"
deploy_subscription=$(az account show --output tsv --query id)

echo "## $deploy_group group in $deploy_region region creation"

az group create -l $deploy_region -n $deploy_group

echo "## Initial function deployment"

function_name=$(az deployment group create --resource-group $deploy_group --template-uri https://raw.githubusercontent.com/groovy-sky/azure-func-go-handler/master/Template/azuredeploy.json | jq -r '. | .properties.outputs.functionName.value')

echo "## HTTP/2 activation"

az rest --method patch --uri "https://management.azure.com/subscriptions/$deploy_subscription/resourceGroups/$deploy_group/providers/Microsoft.Web/sites/$function_name/config/web?api-version=2018-02-01" --body '{"properties":{"http20Enabled":true}}'

echo "## Code build and publish"

[ ! -d "azure-func-go-handler/.git" ] && git clone https://github.com/groovy-sky/azure-func-go-handler
cd azure-func-go-handler/Function && git pull

go build *.go && func azure functionapp publish $function_name --no-build --force

echo "## To verify HTTP/2 support: https://tools.keycdn.com/http2-test?url=https://$function_name.azurewebsites.net" echo "## To run the function: https://$function_name.azurewebsites.net/api/httptrigger

"

Turdie
  • 2,945