Process of getting this error :
The Page consists of 2 end point APIs integrated in it. One is GetLeadsList (GET Call) and another is RegisterLead (POST call) - POST happens through pop-up. Both the APIs are present in the provided screenshot.
There is no error generated when called with the AppService using RestSharp But when the same url is hit by using the service calls, it generates a CORS issue.
Can you help please ? Unable to understand why we are getting the CORS issue CORS issue .
No there are no such errors received in the logs of api application... It is actually a straight forward api call that is being made. But when i checked... there were no errors in the log file.
The api calls are made from our aspnetzero template to the azure portal system of the client... the client has all the logic apps made ready, and to which we are hitting the api. We have already configured CORS to accept * for domain. Does not work from postman. Works on Azure.
So far we have tried the following :
- We have Azure CORS already configured , added wildcard (*) so that it can accept any HTTPS /HTTP requests.
- We have used HTTP Proxies to take care of CORS related issues
- We also tried using chrome extension for CORS. But it still gives CORS error while calling API
- We also tried with creating a service in Angular to directly call the remote API (Without using service proxies). Still we get same error.
- I have attached the Azure configuration image here for your reference.
Even after 4 days of troubleshooting we are stuck with this issue. Apprecite your help urgently....
We are still stuck with the CORS issue described above. Have tried all possible solution without success. Is it possible to have a screen sharing session on MS Teams tomorrow to troubleshoot the issue ? Or even via Remote connection. Please inform suitable time for this .
Finally got this error resolved !!!!
So the first thing i changed in the apim is adding up of the inbound processing. This is the change:
<allowed-origins> <origin></origin> </allowed-origins> <allowed-methods preflight-result-max-age="6000"> <method></method> </allowed-methods> <allowed-headers> <header></header> </allowed-headers> <expose-headers> <header></header> </expose-headers>
- Then i made the change in my service file for posting a new resource as follows:
so this is the change made in the leadsservice app for handling the post call.