[Bug] SQL Server (`shared_sql`) action operations are always routed to `/procedures` with an unresolved path template, so Insert row (V2), Execute a SQL query (V2), Get tables (V2) etc. all return 404
@tonystevenj がすでに取り組んでいます。
2026年10月20日 から。
評価
この issue はまだ評価されていません。
説明
Describe the bug
In @microsoft/managed-apps 0.5.11 (@microsoft/managed-apps-common 0.19.0), every action-mode operation of the SQL Server connector is treated as a stored-procedure call.
ConnectorExecutor._buildOperationUrl (dist/dataClient/data/connectorExecutor.js, lines 333–336) checks apiId.indexOf('shared_sql') > -1. If that's true, it always calls _buildSharedSqlOperationUrl (line 381), which returns:
`${base}${version}datasets/${config.datasetName}/procedures${path}`
This causes three problems:
pathis the operation's raw swagger path template, for example/{connectionId}/v2/datasets/{server},{database}/tables/{table}/itemsforPostItem_V2. Its placeholders are never substituted, and it gets appended after/procedures.config.datasetNameis empty for an action-mode connection reference ("dataSets": {}inms.config.json), which producesdatasets//procedures/....- The resulting URL doesn't exist, so the connector returns 404 for every SQL action. That includes Insert row (V2) (
PostItem_V2), Execute a SQL query (V2) (ExecutePassThroughNativeQuery_V2), Get tables (V2) (GetTables_V2) and Get rows (V2) (GetItems_V2).
Other connectors go through _buildStandardOperationUrl, which resolves path parameters.
The substring check also matches shared_sqldw (Azure SQL Data Warehouse).
Steps to Reproduce
- Create a code app from the App Builder v1 template (
"@microsoft/managed-apps": "0.5.11"). - Create a SQL Server (
shared_sql) connection with Microsoft Entra ID Integrated authentication. Our target was a Microsoft Fabric SQL database. The connection is valid: table-mode reads through it succeed. - Add the SQL Server connector as an action-mode data source. This generates
SQLServerServicewith 22 operations, includingPostItem_V2,GetTables_V2,GetItems_V2andExecutePassThroughNativeQuery_V2. - Call:
Result: 404.await SQLServerService.GetTables_V2("<server>.database.fabric.microsoft.com", "<database>"); - Call:
Result: 404.await SQLServerService.ExecutePassThroughNativeQuery_V2( "<server>.database.fabric.microsoft.com", "<database>", { query: "SELECT COUNT(*) AS Orders FROM SalesLT.SalesOrderHeader" }); PostItem_V2(server, database, table, item)(Insert row (V2)) takes the same code path and builds the same kind of invalid URL. See Additional context.
Expected behavior
SQL Server action operations resolve their own path template the same way other connectors do. For example, Insert row (V2) should be:
POST <runtimeUrl>/<connectionId>/v2/datasets/<server>,<database>/tables/<table>/items
Content-Type: application/json
Only real stored-procedure operations (ExecuteProcedure, ExecuteProcedure_V2) should use the /procedures route.
Actual behavior
Every SQL Server action returns 404 Resource not found. Going by the code, the URL that gets built has this shape:
<runtimeUrl>/<connectionId>/datasets//procedures/{connectionId}/v2/datasets/{server},{database}/tables/{table}/items
The literal {connectionId}, {server}, {database} and {table} placeholders are never substituted.
In the same app, on the same connection and at the same moment, table-mode getAll() returns 200.
Screenshots or Error Messages
Each action call returned:
{"message":"{\"statusCode\":404,\"message\":\"Resource not found\"}","status":404}
Observed repeatedly between 2026-10-20T15:30Z and 15:44Z (UTC) for:
ExecutePassThroughNativeQuery_V2(4 different queries)GetTables_V2with the real server and databaseGetTables_V2with"default","default"
Relevant library code (@microsoft/managed-apps-common 0.19.0, dist/dataClient/data/connectorExecutor.js):
async _buildOperationUrl(operation, config) {
const isSharedSql = (config.apiId ?? '').indexOf('shared_sql') > -1; // line 333
const path = dataSourceInfo.apis[operationName].path; // raw template
if (isSharedSql) {
return this._buildSharedSqlOperationUrl(config, path); // line 336
}
return this._buildStandardOperationUrl(operation, config, operationName, path);
}
_buildSharedSqlOperationUrl(config, path) {
const version = config.version ? `/${config.version}/` : '/';
const base = this._joinRuntimeAndConnection(config.runtimeUrl, config.connectionId);
return `${base}${version}datasets/${config.datasetName}/procedures${path}`; // line 381
}
Environment information
- Node.js and npm version: node v24.7.0, npm 11.19.0 (bun 1.3.14 is used by the template's dev server)
- Are you on an enterprise network (e.g. behind a corporate proxy or firewall)? Not relevant: the URL is wrong before the request leaves the client library. Reproduced in the hosted App Builder preview in Copilot Studio; requests are relayed by the Power Platform host.
- Framework, build tool or relevant package used: React 19.2.5, Vite 7.3.5, TypeScript 5.8.3, @tanstack/react-query 5.100.6,
@microsoft/managed-apps0.5.11 (@microsoft/managed-apps-common0.19.0) - Any connection/components: SQL Server connector (
shared_sql), Microsoft Entra ID Integrated authentication, target is a Microsoft Fabric SQL database (AdventureWorksLT sample)
Additional context
PostItem_V2(Insert row (V2)) was deliberately not sent live, to avoid writing a test row to a real database. Its failure is inferred from the code above, which is the same path that produced the observed 404s.- Removing and re-adding the action-mode data source after a usable connection existed did not change the result.
- Combined with the table-mode 415 bug, an app in this version has no working way to write to SQL Server: table inserts fail with 415 and every action fails with 404.
- Suggested fix:
- Route to
/proceduresonly for the stored-procedure operations. - Send every other
shared_sqloperation through_buildStandardOperationUrlwith path-parameter substitution. - Match the api id exactly (
shared_sql) rather than by substring.
- Route to
- 主要言語
- TypeScript
- スター
- 27
- フォーク
- 8
- 平均マージ
- 5時間 29分
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/managed-apps のほかの issue
-
[Bug] Power BI connector generated client fails TypeScript type check (Goals operations)対応中かも @eschavez が 1 日前に担当しました。 オープンbug
microsoft/managed-apps#47 · コメント 1 件 · 担当者 1 名 ·
-
[Bug] Table-mode create/update sends a JSON body without a Content-Type header, so the SQL Server connector rejects inserts with 415 "media type 'text/plain' is not supported対応中かも @tonystevenj が 3 日前に担当しました。 オープンbug product team investigating
microsoft/managed-apps#44 · コメント 1 件 · 担当者 1 名 ·
-
[Bug] Cannot block Tenant wide CLI path対応中かも @ergonza93 が 3 日前に担当しました。 オープンbug
microsoft/managed-apps#43 · コメント 1 件 · 担当者 1 名 ·
-
[Bug] `ms app clone` fails on macOS対応中かも @sokhenglim1 が 2 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
microsoft/managed-apps#42 · コメント 1 件 · 担当者 1 名 ·
-
[Bug] Device-code sign-in fails with post_request_failed: invalid_client in CLI 0.27.0–0.29.0対応中かも @jiankai82 が 3 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
microsoft/managed-apps#39 · コメント 3 件 · 担当者 1 名 ·
microsoft/managed-apps の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
farion1231/cc-switch#8829 ·
メンテナーはふだん 1 日以内に返信
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverオープンdoc-audit enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100