Reputation: 1
I create an API for the first time and when I publish in azure, for testing and learning, every time I test the GET function I receive this
HTTP/1.1 500 Internal Server Error
content-length: 0 date: Sat, 27 Mar 2021 02:23:57 GMT ocp-apim-apiid: gameslibrary ocp-apim-operationid: get-jogos-getid-id ocp-apim-subscriptionid: master ocp-apim-trace-location: https://apimstpybsp1axvzdf4aexhk.blob.core.windows.net/apiinspectorcontainer/tQH3FZsFKaVfPQRaAAUemQ2-18?sv=2019-07-07&sr=b&sig=Kw0KsFABS4Z7ZJhyHNsEchsglcH5txW1yqNY0hx%2Be8o%3D&se=2021-03-28T02%3A23%3A55Z&sp=r&traceId=a1d01c85dd4e4070ba332731a91aa05d vary: Origin x-powered-by: ASP.NET
I have no idea where's the problem, can anyone pls help me OBS: in the localhost works, only at azure no
Upvotes: 0
Views: 3049
Reputation: 7810
Usually, without looking at the trace, it's hard to say, what went wrong. But in your particular case 500 response was returned by backend.
When test call is made from Azure Portal (or with trace headers), response will contain ocp-apim-trace-location header, it will point to trace of performed call. Researching this trace usually answers questions where error was produced. In your case you should be able to see "backend", it should contain information about what request was made to your backend and what response was received.
Upvotes: 1
Reputation: 731
I didn't click that link (as far as I know they're often meant to be confidential), but have you tried checking allowed IP addresses?
Also (update):
Check that wherever you're calling the API from has a http tunnel allowed out. This depends on the exact nature of the place you're deploying your custom code to. You haven't told us.
Upvotes: 0