Azure / Azure/data-api-builder

[Bug]: auto-config-simulate - fails to read config

オープン
#3,791 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug triage
主要言語
C#
スター
1.5k
フォーク
370
平均マージ
3日 22時間
マージ済み PR(30日)
9

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

`auto-config-simulate` CLI エントリポイントから始め、提供された `.\dab-config.json` をローカル SQL コンテナーに対して使用して、その設定読み込みパスを `dab start` と比較します。バージョン 2.0.12 で失敗を再現し、シミュレーションが有効な設定を読み込み、`autoentities` 定義を正常に処理することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, sql
領域
cli, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
67/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。