Friday, May 27, 2022

ERROR: Runtime dotnet-isolated not supported for os windows, When creating a function app

I was trying to create an Azure function app for .NET 6.0 with dotnet-isolated and functions ver 4 in May 2022 when I got these errors:


Error: Command failed: az functionapp create --name myapp-functions-qa --storage-account myappsaqa --runtime dotnet-isolated --app-insights-key "myapp-functions-ai-qa" --os-type Windows --plan myapp-functions-asp-qa --functions-version 4


ERROR: Runtime dotnet-isolated not supported for os windows. Supported runtimes for os windows are: ['dotnet', 'dotnet', 'node', 'node', 'node', 'java', 'java', 'powershell', 'powershell', 'custom']. Run 'az functionapp list-runtimes' for more details on supported runtimes. 


Surprisingly, I was able to create a function app a month earlier using the dotnet-isolated runtime. Something must have changed with Azure. Lot of search didn't lead me to any solution.

After trying several things, the workaround I found was to create the function app with dotnet runtime as below:

az functionapp create --name myapp-functions-qa --storage-account myappsaqa --runtime dotnet --app-insights-key "myapp-functions-ai-qa" --os-type Windows --plan myapp-functions-asp-qa --functions-version 4


After the app is created, I simply updated the app runtime to dotnet-isolated. And this surprisingly worked.


az functionapp config appsettings set --name myapp-functions-qa --resource-group MYAPP_RG --settings "FUNCTIONS_WORKER_RUNTIME=dotnet-isolated"

Now your function app should work in dotnet-isolated mode.

Till Microsoft makes the dotnet-isolated runtime official, use this workaround.


No comments:

Post a Comment