cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Bad Gateway Azure SQL Stored Procedure

Getting a "Bad Gateway" error for a Flow. Aimed at Azure SQL, not on-prem. Where is the gateway?

Simple Flow:

- Push button

- Run Stored Procedure

- Will not run.

image.png

image.png

- I have the Azure SQL Server set to "Allow Azure services..."

image.png

Please advise.

Thank you

3 REPLIES 3
ericonline
Community Champion
Community Champion

Here is the error after the Flow times out. Do I need to grant special perms to my Flow connection? Its an Active Directory user but I'm admin on the DB.

{
  "error": {
    "code": 502,
    "source": "flow-apim-msmanaged-na-centralus-01.azure-apim.net",
    "clientRequestId": "redacted",
    "message": "BadGateway",
    "innerError": {
      "status": 502,
      "message": "Principal '@userNameParam' could not be found or this principal type is not supported.\r\nCannot add the principal ''@userNameParam'', because it does not exist or you do not have permission.\r\nclientRequestId: redacted",
      "error": {
        "message": "Principal '@userNameParam' could not be found or this principal type is not supported.\r\nCannot add the principal ''@userNameParam'', because it does not exist or you do not have permission."
      },
      "source": "sql-eus2.azconn-eus2.p.azurewebsites.net"
    }
  }
}

 

Hm... I can't figure out why this isn't working.

Just:

- Created a new role in the Azure SQL database

  - `CREATE ROLE powerappsAdmins`

- Granted execute permissions for the Stored Procedures to the new role

  - `GRANT EXECUTE ON dbo.sp_custom_addADUser TO powerappsAdmins;`

- Created a new SQL Connection in Flow

  - **NOTE:** Clicking "Add Connection" from the three dots does not allow a new AD Connection to be made. I had to click Data/Connections and add a new AD connection there.

Does the Stored Procedure action in Flow support AD USERS?

Hi,

 

Looking at this, this will require some deep in-depth troubleshooting. You are getting quite a few conflicting errors here. I would suggest to open a case with Microsoft Support. I'll include a link below; on how to reach out to them. If any other communities members may have run into this feel free to chime in.

 

If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (51,609)