Try to to add https://portal.azure.com to your CORS allowed origins. someone here ran into the same issue. Check this article for more info: https://video2.skills-academy.com/en-us/answers/questions/1304180/unable-to-test-run-azure-function-form-the-portal
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards,
Abiola