Thank you for posting your query here!
Based on the information you provided, it seems that the issue is with the backend Spring Boot 2 app deployed as Azure Web App. The error message you provided indicates that there is an internal server error (500) when the frontend app tries to get the pdf file from the backend app.
One possible reason for this issue could be that the backend app is not able to generate the pdf file correctly. You mentioned that the backend app generates the pdf file and sends it as a byte array with 'application/pdf' header. However, it is not clear from the code you provided how the byte array is being sent to the frontend app.
Another possible reason for this issue could be related to the staticwebapp.config.json file. You mentioned that you added this file and it worked for some time on Azure. However, it stopped working later. It is possible that the changes made to this file are causing the issue.
If possible, please try rolling back the changes to a known working state and then gradually reintroduce them while checking for the issue.
To troubleshoot this issue, you can try the following steps:
1. Check the backend app logs to see if there are any errors or exceptions being thrown when the pdf file is being generated. You can also try to generate the pdf file locally and see if it works correctly.
2. Check the network traffic between the frontend and backend apps to see if the request and response are being sent correctly.
3. Check the staticwebapp.config.json file to see if there are any errors or typos in the configuration. You can also try to remove this file and see if it works correctly without it.
4. You can also try to redeploy the Web App or Static Web App to see if it resolves the issue.
Please let us know if the issue persists. I’m happy to assist you further.