An Azure service that provides customers with a serverless container experience.
Container Instance running Spring Boot CORS Error
So I am running a Container Instance with docker that loads a Spring Boot backend to which I am supposed to be able to make API calls, but I am getting a CORS error.
Access to fetch at 'http://[Azure Container Instance Public IP]:8080/api/puzzle/get/3a2a1397-2a7e-4df9-8f27-16671f3cbd61/0' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
For my CORS configuration in Spring Boot I have allowed origins localhost:3000, [My local machine public IP] and [My local machine public IP]:3000. and my React application sends forward the origin http://localhost:3000.
I am using a React application to connect to the Azure service, but it does not work. When I copy the exact same set up to my local machine and port forward everything, I am getting no issues at all. Ports 80 and 8080 are enabled on Container Instance in Azure.
Why does Azure give me these issues?