cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Getting server returned an http error with code 500

Hello All!
I have one API which I integrated with PowerApps application. So what's happening whenever I am running API through application, it is creating resource group and Vm in Azure. 

Here the problem is first time when I am calling API in any Powerapps application, it working fine. But when I am running it second time, it is giving me an error - "Getting server returned an http error with code 500"

 

Screenshot 2020-12-03 120559.png

 

I followed this link, but got what to do, as it is referring  to power automate - https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-handle-a-Server-Error-500-from-callin...

 

Can someone please help me wit this?

Thanks in advance!!

5 REPLIES 5
Community Support
Community Support

Hi @Saurabh-704 :

Firstly, considering that it worked normally before, I suggest you delete this formula and add it again, the error should be eliminated.(Or you can consider resetting the app to the previous version)

Seconldy,based on the information you currently provide, I can’t determine what caused the error.

The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response. 

Finally,the solution in the link you provided is not to solve the 500 error, but to go to another branch when an error occurs (return to the default value).

If this problem continues to occur, I suggest you create a support ticket.

Best Regards,

Bof

Thank you @v-bofeng-msft for your reply. Actually I have one version only. The thing is when I am running that API by clicking on button first time through application, its working fine. When I run second time through same application, It is giving that error. Dont know why?!

 

I have created 3-4 sample application by for testing, first time that API is working fine, but from second time its giving an error. 

Super User
Super User

Hi @Saurabh-704 , 

 

 Here is my analysis on this. 

 

1. Looks like on your first call it does created the resource group and VM on the first instance. 

2. When you call the API again I believe it is passing the same parameter to create the step 1 again. Try changing this to dynamic parameter and see how it works. 

3. Also in Azure check whether you any CORS policy available. If so then you need to enable the CORS strictly as you are calling API from PowerAPPS. 

 

But my hunch is you are trying to create the same resource again or there should be a waiting time until your first API call response has return success. 

 

Hope it helps in you some way . 

 

------------

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Super User
Super User

Hey @Saurabh-704 , 

 

 Did my analysis helped you in some way. If so kindly update the thread and if it is successful please mark my solution as answers. So that other users can get benefit from the thread. 

 

Thanks 

Hey @ragavanrajan Sorry for the late update. Actually the thing is I was passing parameter dynamically only. And I think it was not related to CORS policy, because if it would be related to CORS policy then at first place only it would not allow us to created VM through API in PowerApps.

As per now, when I debug and did some RnD and testing, I was getting error related to quota issue. Like for example per location can have limited no of VM's or resources only. So I thinks thats the reason but then also not sure!
Thank you once again!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (89,577)