Azure App Services supports .NET 5: Read More: .NET 5 now available in App Service
Did you change the target framework of your app service to be .NET 5?
If you are creating a new app service, you can see .NET 5 under Runtime stacks.
Please let us know if you are still facing issues trying to target to .NET 5.