在現有的 Data API 產生器組態檔中設定非實體執行階段和資料來源屬性。 未指定的選項會讓現有值保持不變。 如果提供的任何選項無效,則整個更新都會失敗 (全有或全無)。
語法
dab configure [options]
備註
此指令不會變更區 entities 段。 用於 dab update 實體變更。
快速瀏覽
-c, --config
設定檔的路徑。 預設為 dab-config.json 除非 dab-config.<DAB_ENVIRONMENT>.json 存在,其中 DAB_ENVIRONMENT 是環境變數。
Example
--data-source.database-type
資料庫類型。
允許的值:
MSSQLPostgreSQLCosmosDB_NoSQLMySQL
Example
產生的設定
{
"data-source": {
"database-type": "postgresql"
}
}
--data-source.connection-string
資料來源的連接字串。
Example
dab configure \
--data-source.connection-string "Server=myserver;Database=mydb;User Id=myuser;Password=mypassword;"
--data-source.options.database
適用於 NoSql 的 Cosmos DB 資料庫名稱。
Example
--data-source.options.container
適用於 NoSql 的 Cosmos DB 容器名稱。
Example
--data-source.options.schema
Cosmos DB for NoSQL 的架構路徑。
Example
--data-source.options.set-session-context
啟用會話上下文。
允許的值:
-
true(預設值) false
Example
產生的設定
{
"data-source": {
"options": {
"set-session-context": false
}
}
}
--runtime.graphql.depth-limit
Max 允許巢狀查詢的深度。
允許的值:
- $(0,2147483647]$(含)
-
-1以移除限制
Example
產生的設定
{
"runtime": {
"graphql": {
"depth-limit": 3
}
}
}
--runtime.graphql.enabled
啟用 DAB 的 GraphQL 端點。
Example
--runtime.graphql.path
自訂 DAB 的 GraphQL 端點路徑。 路徑前綴為 /。
Example
--runtime.graphql.allow-introspection
允許或拒絕 GraphQL 的內省請求。
Example
--runtime.graphql.multiple-mutations.create.enabled
在產生的 GraphQL 架構中啟用或停用多重變異創建操作。
Example
--runtime.rest.enabled
啟用 DAB 的 REST 端點。
Example
--runtime.rest.path
自訂 DAB 的 REST 端點路徑。 路徑前綴為 /。
Example
產生的設定
{
"runtime": {
"rest": {
"path": "/myapi"
}
}
}
--runtime.rest.request-body-strict
禁止多餘的 REST 請求正體欄位。
Example
--runtime.mcp.enabled
啟用 DAB 的 MCP 端點。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
產生的設定
{
"runtime": {
"mcp": {
"enabled": false
}
}
}
--runtime.mcp.path
自訂 DAB 的 MCP 端點路徑。 路徑前綴為 /。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
產生的設定
{
"runtime": {
"mcp": {
"path": "/mcp2"
}
}
}
--runtime.mcp.dml-tools.enabled
啟用 DAB 的 MCP DML 工具端點。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.describe-entities.enabled
啟用 DAB 的 MCP 描述實體工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.create-record.enabled
啟用 DAB 的 MCP 建立錄音工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.read-records.enabled
啟用 DAB 的 MCP 讀取記錄工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.update-record.enabled
啟用 DAB 的 MCP 更新記錄工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.delete-record.enabled
啟用 DAB 的 MCP 刪除錄音工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.mcp.dml-tools.execute-entity.enabled
啟用 DAB 的 MCP 執行實體工具。
備註
此選項僅在 v1.7 預發布 CLI(目前為 RC)中提供。 安裝時用 dotnet tool install microsoft.dataapibuilder --prerelease.
Example
--runtime.cache.enabled
全域啟用 DAB 快取。 你也必須為每個實體啟用快取功能。
Example
產生的設定
{
"runtime": {
"cache": {
"enabled": true
}
}
}
--runtime.cache.ttl-seconds
自訂 DAB 快取的全域預設時間,設定為秒數。
Example
產生的設定
{
"runtime": {
"cache": {
"enabled": false,
"ttl-seconds": 30
}
}
}
--runtime.host.mode
設定主機的 DAB 運行模式。
允許的值:
DevelopmentProduction
Example
產生的設定
{
"runtime": {
"host": {
"mode": "development"
}
}
}
--runtime.host.cors.origins
在 CORS 中允許重寫起源。 以空格分隔的清單形式提供數值。
Example
產生的設定
{
"runtime": {
"host": {
"cors": {
"origins": [
"https://contoso.com",
"https://fabrikam.com"
]
}
}
}
}
--runtime.host.cors.allow-credentials
設定標頭的 Access-Control-Allow-Credentials 值。
Example
--runtime.host.authentication.provider
設定認證提供者名稱。
Example
--runtime.host.authentication.jwt.audience
設定 JWT 代幣的預定接收者。
Example
--runtime.host.authentication.jwt.issuer
設定發行 JWT 令牌的實體。
Example
dab configure \
--runtime.host.authentication.jwt.issuer https://login.microsoftonline.com/common/v2.0
產生的設定
{
"runtime": {
"host": {
"authentication": {
"provider": "AppService",
"jwt": {
"audience": "api://my-app",
"issuer": "https://login.microsoftonline.com/common/v2.0"
}
}
}
}
}
--azure-key-vault.endpoint
設定 Azure Key Vault 端點網址。
Example
--azure-key-vault.retry-policy.mode
設定重試政策模式。
允許的值:
fixedexponential
Example
--azure-key-vault.retry-policy.max-count
設定最大重試次數。
Example
--azure-key-vault.retry-policy.delay-seconds
將重試間隔設定為幾秒鐘。
Example
--azure-key-vault.retry-policy.max-delay-seconds
在指數模式下,設定重試間最大延遲以秒為單位。
Example
--azure-key-vault.retry-policy.network-timeout-seconds
設定網路逾時,請求時間為幾秒。
Example
產生的設定
{
"azure-key-vault": {
"retry-policy": {
"mode": "fixed",
"max-count": 5,
"delay-seconds": 2,
"max-delay-seconds": 30,
"network-timeout-seconds": 20
}
}
}
--runtime.telemetry.azure-log-analytics.enabled
啟用或停用 Azure Log Analytics。
Example
--runtime.telemetry.azure-log-analytics.dab-identifier
設定 Azure Log Analytics 中使用的 DAB 識別字串。
Example
--runtime.telemetry.azure-log-analytics.flush-interval-seconds
為 Azure Log Analytics 設定秒數沖洗間隔。
Example
--runtime.telemetry.azure-log-analytics.auth.custom-table-name
為 Azure Log Analytics 設定自訂資料表名稱。
Example
--runtime.telemetry.azure-log-analytics.auth.dcr-immutable-id
Configure DCR immutable ID for Azure Log Analytics.
Example
--runtime.telemetry.azure-log-analytics.auth.dce-endpoint
為 Azure Log Analytics 配置 DCE 端點。
Example
dab configure \
--runtime.telemetry.azure-log-analytics.auth.dce-endpoint https://example.eastus-1.ingest.monitor.azure.com
產生的設定
{
"runtime": {
"telemetry": {
"azure-log-analytics": {
"enabled": true,
"auth": {
"custom-table-name": "MyDabLogs",
"dcr-immutable-id": "dcr-123",
"dce-endpoint": "https://example.eastus-1.ingest.monitor.azure.com"
},
"dab-identifier": "MyDab",
"flush-interval-seconds": 10
}
}
}
}
--runtime.telemetry.file.enabled
啟用或關閉檔案匯入記錄。
Example
--runtime.telemetry.file.path
設定檔案匯入記錄的路徑。
Example
--runtime.telemetry.file.rolling-interval
設定檔案匯入記錄的滾動間隔。
允許的值:
MinuteHourDayMonthYearInfinite
Example
--runtime.telemetry.file.retained-file-count-limit
設定保留檔案的最大數量。
Example
--runtime.telemetry.file.file-size-limit-bytes
設定最大檔案大小限制(以位元組為單位)。
Example
產生的設定
{
"runtime": {
"telemetry": {
"file": {
"enabled": true,
"path": "C:\\logs\\dab-log.txt",
"rolling-interval": "Month",
"retained-file-count-limit": 5,
"file-size-limit-bytes": 2097152
}
}
}
}
--help
顯示此說明畫面。
Example
--version
顯示版本資訊。