Function Apps only support .Net 6, if you want to use anything later you need to migrate to the isolated worker model. They've
talked about supporting .Net 8, however they're deprecating the in-process worker model in 2026 so it's worth looking into switching to isolated worker anyway.