-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
Description
Describe the bug
- After updating to Power Apps SDK 1.0 (^1.0.3) - Stored Procedure metadata / parameters incorrectly parsed
Steps to Reproduce
- We upgraded our Code app to be the latest version using the microsoft guide.
package.json:
{
"name": "vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@fluentui-contrib/react-data-grid-react-window": "^1.4.2",
"@fluentui/react-components": "^9.72.2",
"@fluentui/react-datepicker-compat": "^0.6.22",
"@microsoft/power-apps": "^1.0.3",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"uuid": "^13.0.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.1",
"@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"eslint": "^9.39.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4"
}
}- Deleted node modules - and re-installed
- ran
npm run dev - Inspected network traces in code app (running locally)
- Normal table calls (sql server connector) still work just fine
- Stored procedure's input parameters is malformed
Expected behavior
- Example of the network call in the current live and correct app:
https://unitedstates-002.azure-apim.net/invokex-ms-request-url /apim/sql/49d2b9f70e2a42a89407d1648b01d2f1/v2/datasets/database.corp.foo.com,DATABASE/procedures/dbo.SP_StoredProcedure- Valid request:

- This returns a valid data set:

Actual behavior
- Example of network call in the local app (after updating to 1.0.3 sdk)
https://unitedstates-002.azure-apim.net/invokex-ms-request-url /apim/sql/49d2b9f70e2a42a89407d1648b01d2f1/v2/datasets/database.corp.foo.com,DATABASE/procedures/dbo.SP_StoredProcedure- Invalid request:

- Returns no data set:

- Note that the request 'body' is not longer a JSON object - but is instead a string. And as a result has lost the
HouseholdIdkey
Environment information
- Code apps is confirmed to be on (the code app has been pushed successfully in the very same environment)
- Framework, build tool or relevant package used: [React,Vite, Webpack, etc] (the standard code-app setup generated via the CLI)
- Connection components: [only SQL]
- PAC CLI:
Version: 2.2.1+g666525f (.NET Framework 4.8.9325.0)
Additional context
- The current
power.config.json:
{
"appId": "62d2676c-8513-488e-a6a4-08f97837c2a4",
"appDisplayName": "App Name",
"description": null,
"environmentId": "e3ef97eb-a6b2-47e2-acd6-3382fc9f0b62",
"buildPath": "./dist",
"buildEntryPoint": "index.html",
"logoPath": "Default",
"localAppUrl": "http://localhost:3000/",
"connectionReferences": {
"4bbe62d0-ffb9-47ad-bf2a-8f2d149b6884": {
"id": "/providers/Microsoft.PowerApps/apis/shared_sql",
"displayName": "SQL Server",
"dataSources": [
//..other sql data source ommitted
"_4bbe62d0_ffb9_47ad_bf2a_8f2d149b6884_sp"
],
"authenticationType": "windowsAuthentication",
"sharedConnectionId": "/providers/Microsoft.PowerApps/apis/shared_sql/connections/49d2b9f70e2a42a89407d1648b01d2f1",
"dataSets": {
"database.corp.foo.com,DATABASE": {
"dataSources": {
//..other sql data source ommitted
"_4bbe62d0_ffb9_47ad_bf2a_8f2d149b6884_sp": {}
}
}
},
"xrmConnectionReferenceLogicalName": "connection_name_here"
}
},
"databaseReferences": {},
"region": "prod",
"version": "1.0"
}- Note: when we upgraded the app - it added the
versionconfig - but made no other changes - The current schema of the stored procedure service:
import { dataSourcesInfo } from '../../../.power/schemas/appschemas/dataSourcesInfo';
import type { IOperationResult } from '@microsoft/power-apps/data';
import { getClient } from '@microsoft/power-apps/data';
import type { SP_StoredProcedureResponse } from '../models/SP_GetLatestPositionsForHouseholdModel';
export class SP_StoredProcedureService {
private static readonly dataSourceName = '_4bbe62d0_ffb9_47ad_bf2a_8f2d149b6884_sp';
private static readonly client = getClient(dataSourcesInfo);
public static async SP_StoredProcedure(HouseholdId?: string): Promise<IOperationResult<SP_StoredProcedureResponse >> {
const params: { HouseholdId?: string } = { HouseholdId };
const result = await SP_StoredProcedureService .client.executeAsync<{ HouseholdId?: string }, SP_StoredProcedureResponse >(
{
connectorOperation: {
tableName: SP_StoredProcedureService .dataSourceName,
operationName: 'SP_StoredProcedure',
parameters: params
},
});
return result;
}
}- Note: in our code - the stored procedure is not actually called
StoredProcedure- but i've edited the name for security - All connections in the Code app move through a singular connection reference
- This code app also uses several SQL tables. Those appear to be unaffected and are working just fine
What We've Tried
- I assumed this was a problem with the scaffolded (maybe the newer version of the PAC CLI generates a stored procedure scaffolding in a different way in 1.0
- I removed the datasource - and re added (still through the connection referenece) - and the scaffolded code was generated exactly the same
- I put a debugger statement in the
SP_StoredProceduremethod to confirmHouseholdIdandparamsare valid - both are correct
Hypothesis
- I hypothesize that something is wrong in the
client.executeAsyncthat it's stripping part ofparamsoff - or maybe taking an incorrectObject.valuesfrom the input params.
Reactions are currently unavailable