Apologies for facing issue on this! Thanks for reaching here!
The issue has been identified- where the SWA apps, all the calls to backend API fail with 401 error, our team is working on fix, will update here accordingly.
Suggested Workaround:
You can change the AuthenticationLevel to Anonymous for your function.
It's safe to set the AuthorizationLevel as Anonymous, as we have another layer of authorization checks (EasyAuth) in place so that only SWA can access the managed function endpoints and not anyone else.
Hope this helps. Will keep posted here.
Update-6/8-
The fix has been rolled out to all affected SWA regions and the issue is mitigated now. You can redeploy your app if still experiencing issues.