在现有数据 API 生成器配置文件中配置非实体运行时和数据源属性。 未指定的选项使现有值保持不变。 如果提供的任何选项无效,则整个更新将失败(全无)。
Syntax
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
Cosmos DB for NoSql 的数据库名称。
Example
--data-source.options.container
Cosmos DB for NoSql 的容器名称。
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
嵌套查询的最大允许深度。
允许的值:
- $(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 终结点 URL。
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
为 Azure Log Analytics 配置 DCR 不可变 ID。
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
显示版本信息。