[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 ci sta già lavorando.
Dal 20/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Describe the bug
In @microsoft/managed-apps 0.5.11 (which uses @microsoft/managed-apps-common 0.19.0), creating a record through a table-mode data source fails against the SQL Server connector (shared_sql) with HTTP 415.
RuntimeDataClient.createDataAsync (dist/dataClient/data/runtimeDataClient.js, line 49) serializes the record with body: JSON.stringify(body) but sets no Content-Type. _createHeaders() only adds Accept: application/json, x-ms-protocol-semantics: cdp, ServiceNamespace and x-ms-enable-selects. The string body then goes through host.sendHttpRequest with no content type. It arrives at the connector as text/plain, which is also the fetch default for a string body, and the connector rejects it.
updateDataAsync (line 74) has the same pattern.
The action path is inconsistent with this: ConnectorExecutor.executeAsync (connectorExecutor.js, lines 135–139) explicitly adds Content-Type: application/json whenever a body is present.
Reads on the same data source and connection work.
Steps to Reproduce
-
Create a code app from the App Builder v1 template. Its
package.jsonpins"@microsoft/managed-apps": "0.5.11". -
Create a SQL Server (
shared_sql) connection with Microsoft Entra ID Integrated authentication to a SQL database. Our repro used a Microsoft Fabric SQL database with the AdventureWorksLT sample loaded. -
Add a table-mode data source:
- dataset:
<server>.database.fabric.microsoft.com,<database> - table:
[SalesLT].[SalesOrderHeader]
This generates
SalesOrderHeaderServicewithcreate,update,delete,getandgetAll. - dataset:
-
Control: call
await SalesOrderHeaderService.getAll({ top: 1 });It succeeds and returns rows.
-
Call:
const result = await SalesOrderHeaderService.create({ CustomerID: 29485, OrderDate: "2026-10-20T00:00:00Z", DueDate: "2026-10-27T00:00:00Z", ShipMethod: "CARGO TRANSPORT 5", SubTotal: 100, TaxAmt: 0, Freight: 0, } as Omit<SalesOrderHeader, "SalesOrderID">); -
result.successisfalse, with HTTP 415.
Expected behavior
The POST to .../datasets/<server>,<database>/tables/[SalesLT].[SalesOrderHeader]/items is sent with Content-Type: application/json. The row is inserted and the created record is returned in result.data.
Actual behavior
The request is sent without a Content-Type header and the connector answers HTTP 415. No row is inserted.
There is no app-side workaround:
- The data client exposes no way to set request headers for
createRecordAsync/updateRecordAsync. - Passing a pre-stringified body gets stringified a second time.
- The package version is pinned by the template.
Screenshots or Error Messages
SQL table insert failed
{"message":"{\"error\":{\"code\":\"\",\"message\":\"The request entity's media type 'text/plain' is not supported for this resource.\"},\"debugInfo\":\"clientRequestId: f7458049-157a-4476-b4c8-6a9d4020a2b2\"}","status":415,"requestId":"f7458049-157a-4476-b4c8-6a9d4020a2b2"}
- First failure: 2026-10-20T15:52:31Z, clientRequestId
f7458049-157a-4476-b4c8-6a9d4020a2b2 - Second failure: 2026-10-20T15:53:00Z, clientRequestId
afba0685-f72e-4beb-bf0b-2e7a393e8347, with the same 415
Relevant library code (@microsoft/managed-apps-common 0.19.0, dist/dataClient/data/runtimeDataClient.js):
async createDataAsync(url, apiId, connectionId, tableName, body, operationName) {
const config = { url, method: HttpMethod.POST, apiId, connectionId, tableName,
body: JSON.stringify(body) }; // no headers -> no Content-Type
return await this._executeRequest(config, { operationName: ... });
}
_createHeaders(config) {
const baseHeaders = { Accept: 'application/json', 'x-ms-protocol-semantics': 'cdp',
ServiceNamespace: config.tableName, 'x-ms-enable-selects': 'true' };
return config.headers ? { ...baseHeaders, ...config.headers } : baseHeaders;
}
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 header is missing 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, schemaSalesLT)
Additional context
- Confirmed live for
createonly.updateuses the same code (line 74) and should fail the same way; this was found by reading the code, not observed live. - The code path is not specific to SQL Server, so table-mode create and update for other tabular connectors are probably affected too. Only SQL Server was verified.
- The same connection reads
SalesOrderHeader,SalesOrderDetail,Product,ProductCategoryandCustomerwithout problems. - Suggested fix: set
headers: { 'Content-Type': 'application/json' }in the configs built bycreateDataAsyncandupdateDataAsync, asConnectorExecutor.executeAsyncalready does for action bodies.
- Lingua principale
- TypeScript
- Stelle
- 27
- Fork
- 8
- Merge medio
- 6h 59m
- PR unite (30g)
- 5
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/managed-apps
-
[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 404Forse già presa @tonystevenj l’ha presa 2 giorni fa. Apertabug
microsoft/managed-apps#45 · 1 assegnatario ·
-
[Bug] Cannot block Tenant wide CLI pathForse già presa @ergonza93 l’ha presa 2 giorni fa. Apertabug
microsoft/managed-apps#43 · 1 commento · 1 assegnatario ·
-
[Bug] `ms app clone` fails on macOSForse già presa @sokhenglim1 l’ha presa 1 giorno fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
microsoft/managed-apps#42 · 1 commento · 1 assegnatario ·
-
[Bug] Device-code sign-in fails with post_request_failed: invalid_client in CLI 0.27.0–0.29.0Forse già presa @jiankai82 l’ha presa 2 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
microsoft/managed-apps#39 · 2 commenti · 1 assegnatario ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/managed-apps#31 · 1 assegnatario ·
Tutte le issue di microsoft/managed-apps
Issue simili
-
createAI: the ai peer range allows ai@6, which the provider cannot work withForse già presa @akhil9tiet l’ha presa oggi. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
cloudflare/agents#2690 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[fullsend] E2E: theme — global-header ignores app.branding.fullLogo (RHDHBUGS-3670)Forse già presa @fullsend-ai-coder l’ha presa oggi. Apertae2e-failure ready-to-code
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4503 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage 📥
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
ethereum/ethereum-org-website#19601 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cloudscape-design/components#5184 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
agilepathway/label-checker#805 ·
I maintainer di solito rispondono entro 1 giorno