能否在Azure静态Web应用(SWA)的数据库预览中配置两张表?
问题:执行
swa start后调用Data API Builder接口出错 相关文件及终端输出截图
- staticwebapp.database.config.json 文件截图
swa start执行后的终端输出截图
问题详情
执行swa start命令后,调用本地地址的/data-api/rest/Courses接口时出现错误。此前修改主键时曾触发配置读取失败的提示,说明当前配置文件已被系统加载读取。
提供的Data API Builder配置文件
{ "$schema": "https://github.com/Azure/data-api-builder/releases/latest/download/dab.draft.schema.json", "data-source": { "database-type": "mssql", "connection-string": "@env('DATABASE_CONNECTION_STRING')" }, "runtime": { "rest": { "enabled": true, "path": "/rest" }, "graphql": { "allow-introspection": true, "enabled": true, "path": "/graphql" }, "host": { "mode": "production", "cors": { "origins": [ "http://localhost:5173" ], "allow-credentials": true }, "authentication": { "provider": "StaticWebApps" } } }, "entities": { "Schedule": { "source": "dbo.schedule", "rest": { "methods": ["get", "post", "put", "delete"], "path": "/Schedule" }, "permissions": [ { "role": "anonymous", "actions": ["read"] } ] }, "Courses": { "source": "dbo.courses", "rest": { "methods": ["get", "post", "put", "delete"], "path": "/Courses" }, "permissions": [ { "role": "anonymous", "actions": ["read"] } ] } } }
内容的提问来源于stack exchange,提问作者vincent nguyen
相关产品推荐
相关产品推荐

