I have deployed a containerised function app using the azure-cli command:
az functionapp create \
--name $function_app_name \
--resource-group $resource_group \
--storage-account $storage_account_name \
--functions-version 4 \
--consumption-plan-location $location \
--os-type Linux \
--runtime python \
--image $container_registry.azurecr.io/$image_name:latest
Where my custom docker image uses the mcr.microsoft.com/azure-functions/python:4-python3.11
base image.
My docker container works when I run it locally, however, after deploying the app to azure using the above command, I cannot view the function in the Azure portal. All I see is "Error while loading functions Encountered an error (ServiceUnavailable) from host runtime":

I see a few warnings when I run the above CLI command:
Runtime docker not supported for os linux. Supported runtimes for os linux are: ['dotnet-isolated', 'dotnet-isolated', 'dotnet-isolated', 'dotnet', 'node', 'node', 'node', 'node', 'python', 'python', 'python', 'python', 'python', 'java', 'java', 'java', 'java', 'powershell', 'custom']. Run 'az functionapp list-runtimes' for more details on supported runtimes.
App settings have been redacted. Use `az webapp/logicapp/functionapp config appsettings list` to view.
Although I'm not sure if these are relevant to the issue. If I omit the --os-type
and --runtime
args it seems to default to windows
and dotnet
.
Why is my function failing to display in the Azure portal?
I am using azure-cli version 2.58.0.