During a current project I came across this error, because my Azure Functions are planned to run on .net 8. There is by default the runtime for .net 7 available, but this leeds to the following error.

There is no Functions runtime available that matches the version in the project.

Error Dialog

The fix for the problem is hidden in Visual Studio options dialog.

Error Dialog

Just click Download & Install, and hit F5.