web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help! Adding a new sto...
Power Apps
Unanswered

Help! Adding a new stored proc causes 403 for existing stored procs.

(0) ShareShare
ReportReport
Posted on by 21
I have a Power App that is part of a solution that is using tables and stored procedures from an on-prem SQL Server database.  I have a full ALM solution with DEV, TEST and PROD environments.  At some point a few weeks back when I added a new stored procedure, a bunch of my other connections somehow "broke" and I get a 403 error that only shows up after I publish.  The only way to fix it is to delete all of my stored proc connections (in the data section within the app) and re-add all of them.  I have 20+ stored procs so this has become quite a pain.  I learned the hard way not to change a stored proc either since that seems to break Power Apps, so I always create a new version and then add a new one.  I also remove the old ones once I no longer am using them. 
 
Everything works fine in DEV until I publish and/or export the solution and move it to TEST.  Is there something I might have done to cause this issue?  Or is this a known bug?  I have an on prem database and am using an on-prem gateway.  I also have connection references set up for my solution so moving form DEV -> TEST -> PROD works well.  Also, another developer recently added Dataverse tables in the same solution but used in a different app.  I don't think this would cause this problem, but maybe someone else knows if that would cause a conflict?
 
Any suggestions would be much appreciated.
 
Example error: SP_MyStoredProc.dbospExampleStoredProc failed: { "error": { "code": 403, "message": "Procedure dbo.spExampleStoredProc is not allowed", "source": "XXXe03594-27cb-ef40-9542-2b6ea670e00f.09.common.usa002.azure-apihub.net", "path": "choose[2]\\when[1]\\choose\\when[2]", "policyId": "", "clientRequestId": "XXXa0fcb-0aea-406d-9cb5-15ef08db8e84", "dreeSet": "true" } }
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,906 Moderator on at
    Do you refresh the connections when you import the solutions into TEST?
    Are any changes made directly to the TEST solution? 
  • TB-20032129-0 Profile Picture
    21 on at
    Do you refresh the connections when you import the solutions into TEST?  This happens before I even do an import.  It happens in DEV after publishing.  It works while building and testing but errors (for some) after publish.
    Are any changes made directly to the TEST solution? No, absolutely not.  
     
    Claude AI did tell me that this is a known bug and it can be solved by creating custom connectors but I haven't had time to try that out to see if it's a permanent solution or not.
  • ronaldwalcott Profile Picture
    3,906 Moderator on at
    Are you refreshing the connection references in your DEV solution after publishing changes?  
  • TB-20032129-0 Profile Picture
    21 on at
    That doesn't seem to be an option.  Within Power Apps you can't refresh a connection to a stored procedure (only tables and views) and the connection reference in the solution doesn't offer refresh either. Do you suggest I edit the connection reference and re-save it?  The only obvious place to "refresh" is under the Connections section, which does nothing to help this situation.
  • ronaldwalcott Profile Picture
    3,906 Moderator on at
    What is your process?
    Did you edit the connection reference in the solution, refresh and save it then republish the app so that it should see the new stored procedure definitions surfaced through the updated connection reference?
  • TB-20032129-0 Profile Picture
    21 on at
    Not sure I follow....
     
    My process is
    1. Make changes in dev, including adding any new stored procs, and test.  It all works.
    2. Publish in dev
    3. Test published version (some stored procs usually fail: some older ones, not the new ones)
    4. If Test passes, export the Solution as a managed solution
    5.  Import the solution into the test environment.  I always check the connection references when I import also.
     
    The weird part is adding the new stored proc doesn't break all of my existing stored procedures, only some of them.  If I only delete those broken ones and re-add them then my new ones are now broken.  It is a vicious cycle so now I just delete ALL of my stored procs (20+) and re-add them and then everything works.  This is a huge pain though, especially when I'm only adding one new stored proc.
     
    I have never done or needed to do any "refreshing" of the connection references or the connection.  And, as I mentioned, it works prior to publish and then doesn't work after publish.
     
    I'm using the same connection reference for all of my stored procedures too.
  • ronaldwalcott Profile Picture
    3,906 Moderator on at
    Reference
     
    This is how I believe connection references work based on the documentation, anybody knowing different should correct me:
     
    The connection reference in the solution determines which database you are connecting to even in your DEV environment.
     
    This would allow you to change the database that your solution in the DEV environment connects to even though in your development studio you may be accessing a different database.
     
    While developing you create a connection to the database which references the metadata describing the stored procedures therefore the app works when you run it using the connection described in the Data section. Republishing the app does not change the existing connection reference. Your published app in the solution uses the connection reference to connect to the database. The connection reference may be using a cached connection so refreshing the connection reference should clear the cache allowing the published app to operate in the same manner as the app running in Power Apps Studio.
     
  • TB-20032129-0 Profile Picture
    21 on at
    I'm very familiar with how connection references work.  As mentioned previously I have a full ALM solution with dev, test and prod and connection references are exactly how I determine which database my solution uses.  Up until a few weeks ago I never had an issue.
     
    Today I made a change in dev to a Notify() and after publishing my stored procedures got the 403 error again.  I did nothing to change any data, data connections, queries, stored procedures, etc.  I only changed the Notify().  This seems like a bug to me, but I was looking for some weird obscure thing that maybe I did to create this issue. 
     
    I was hoping someone from Microsoft would respond to this post to confirm (or deny) this is a known bug.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard