Azure / Azure/data-api-builder
[Bug]: auto-config-simulate - fails to read config
- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 370
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
### What happened?
Getting an error when trying to use `auto-config-simulate` against a local sql server container. But it works and exposes the entities successfully when I do `dab start`
1. create the config against local dbatools container (password is shared online so not a concern)
```powershell
dab init --database-type "mssql" --host-mode "Development" --connection-string "Server=localhost,2500;User Id=sqladmin;Database=pubs;Password=dbatools.IO;TrustServerCertificate=True;Encrypt=True;"
```
2. add the `dbo.%` pattern
```powershell
dab auto-config pubs-tables `
--patterns.include "dbo.%" `
--permissions "anonymous:read"
```
3. view the config it looks good
```powershell
cat .\dab-config.json
```
```text
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v2.0.12/dab.draft.schema.json",
"data-source": {
"database-type": "mssql",
"connection-string": "Server=localhost,2500;User Id=sqladmin;Database=pubs;Password=dbatools.IO;TrustServerCertificate=True;Encrypt=True;",
"options": {
"set-session-context": false
}
},
"runtime": {
"rest": {
"enabled": true,
"path": "/api",
"request-body-strict": false
},
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"mcp": {
"enabled": true,
"path": "/mcp"
},
"host": {
"cors": {
"origins": [],
"allow-credentials": false
},
"authentication": {
"provider": "Unauthenticated"
},
"mode": "development"
},
"telemetry": {
"open-telemetry": {
"enabled": true,
"endpoint": "@env('OTEL_EXPORTER_OTLP_ENDPOINT')",
"headers": "@env('OTEL_EXPORTER_OTLP_HEADERS')",
"service-name": "@env('OTEL_SERVICE_NAME')"
}
}
},
"autoentities": {
"pubs-tables": {
"patterns": {
"include": [
"dbo.%"
]
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "read"
}
]
}
]
}
},
"entities": {}
}
```
4. run the simulate
```powershell
❯ dab auto-config-simulate -c .\dab-config.json
```
get errors
```text
info: Microsoft.DataApiBuilder 2.0.12
info: User provided config file: .\dab-config.json
fail: Failed to read the config file: .\dab-config.json.
fail: Failed to simulate autoentities.
```
But if I do `dab start` the config is fine and all the dbo tables are exposed.
### Version
Microsoft.DataApiBuilder 2.0.12+0b38aa7cbf4118034ad8dee1f2712b1c4bac4c32
### What database are you using?
Azure SQL
### What hosting model are you using?
Local (including CLI)
### Which API approach are you accessing DAB through?
REST
### Relevant log output
```Text
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với điểm vào CLI `auto-config-simulate` và so sánh đường dẫn tải cấu hình của nó với `dab start`, sử dụng `.\dab-config.json` được cung cấp với container SQL cục bộ. Tái hiện lỗi với phiên bản 2.0.12 và xác minh rằng mô phỏng đọc cấu hình hợp lệ và xử lý thành công định nghĩa `autoentities`.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, sql
- Lĩnh vực
- cli, databases
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 67/100