[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 ya está trabajando en esto.
Desde el 20/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 27
- Forks
- 8
- Merge medio
- 6 h 59 min
- PR fusionados (30 d)
- 5
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/managed-apps
-
[Bug] Power BI connector generated client fails TypeScript type check (Goals operations)Posiblemente ocupada @eschavez la tomó hace 1 día. Abiertobug
microsoft/managed-apps#47 · 1 comentario · 1 asignado ·
-
[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 404Posiblemente ocupada @tonystevenj la tomó hace 3 días. Abiertobug product team investigating
microsoft/managed-apps#45 · 1 comentario · 1 asignado ·
-
[Bug] Cannot block Tenant wide CLI pathPosiblemente ocupada @ergonza93 la tomó hace 3 días. Abiertobug
microsoft/managed-apps#43 · 1 comentario · 1 asignado ·
-
[Bug] `ms app clone` fails on macOSPosiblemente ocupada @sokhenglim1 la tomó hace 2 días. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
microsoft/managed-apps#42 · 1 comentario · 1 asignado ·
-
[Bug] Device-code sign-in fails with post_request_failed: invalid_client in CLI 0.27.0–0.29.0Posiblemente ocupada @jiankai82 la tomó hace 3 días. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
microsoft/managed-apps#39 · 3 comentarios · 1 asignado ·
Todos los issues de microsoft/managed-apps
Issues similares
-
bug hacktoberfest help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
libredb/libredb-studio#1941 ·
Los mantenedores suelen responder en 1 día
-
chore other
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alastair-smith/card-games#308 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
paperclipai/paperclip#17379 ·
Los mantenedores suelen responder en 1 día
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Anime Quote 626 (good-first-issue)Abiertocommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
lingdojo/kana-dojo#33040 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
bug mobile ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día