تحرير

مشاركة عبر


configure command

Configure non-entity runtime and data source properties in an existing Data API builder configuration file. Unspecified options leave existing values unchanged. If any provided option is invalid, the entire update fails (all-or-nothing).

Syntax

dab configure [options]

Note

This command does not alter the entities section. Use dab update for entity changes.

Quick glance

Option Summary
-c, --config Path to the config file (default dab-config.json).
--data-source.database-type Set the database type.
--data-source.connection-string Set the database connection string.
--data-source.options.database Database name for Cosmos DB for NoSql.
--data-source.options.container Container name for Cosmos DB for NoSql.
--data-source.options.schema Schema path for Cosmos DB for NoSql.
--data-source.options.set-session-context Enable session context.
--runtime.graphql.depth-limit Limit maximum query depth.
--runtime.graphql.enabled Enable or disable GraphQL endpoint.
--runtime.graphql.path Customize the GraphQL endpoint path.
--runtime.graphql.allow-introspection Allow or deny GraphQL introspection.
--runtime.graphql.multiple-mutations.create.enabled Enable multiple-create mutations.
--runtime.rest.enabled Enable or disable REST endpoint.
--runtime.rest.path Customize the REST endpoint path.
--runtime.rest.request-body-strict Enforce strict REST request body validation.
--runtime.mcp.enabled Enable or disable MCP endpoint.
--runtime.mcp.path Customize the MCP endpoint path.
--runtime.mcp.dml-tools.enabled Enable or disable all MCP DML tools.
--runtime.mcp.dml-tools.describe-entities.enabled Enable or disable the describe-entities tool.
--runtime.mcp.dml-tools.create-record.enabled Enable or disable the create-record tool.
--runtime.mcp.dml-tools.read-records.enabled Enable or disable the read-records tool.
--runtime.mcp.dml-tools.update-record.enabled Enable or disable the update-record tool.
--runtime.mcp.dml-tools.delete-record.enabled Enable or disable the delete-record tool.
--runtime.mcp.dml-tools.execute-entity.enabled Enable or disable the execute-entity tool.
--runtime.cache.enabled Enable or disable global cache.
--runtime.cache.ttl-seconds Global cache TTL in seconds.
--runtime.host.mode Set host mode: Development or Production.
--runtime.host.cors.origins Allowed CORS origins.
--runtime.host.cors.allow-credentials Set CORS allow-credentials.
--runtime.host.authentication.provider Authentication provider.
--runtime.host.authentication.jwt.audience JWT audience claim.
--runtime.host.authentication.jwt.issuer JWT issuer claim.
--azure-key-vault.endpoint Azure Key Vault base endpoint.
--azure-key-vault.retry-policy.mode Retry policy mode.
--azure-key-vault.retry-policy.max-count Max retry attempts.
--azure-key-vault.retry-policy.delay-seconds Delay between retries.
--azure-key-vault.retry-policy.max-delay-seconds Max delay for exponential retries.
--azure-key-vault.retry-policy.network-timeout-seconds Timeout for network calls.
--runtime.telemetry.azure-log-analytics.enabled Enable Azure Log Analytics telemetry.
--runtime.telemetry.azure-log-analytics.dab-identifier Distinguish log origin.
--runtime.telemetry.azure-log-analytics.flush-interval-seconds Flush cadence in seconds.
--runtime.telemetry.azure-log-analytics.auth.custom-table-name Custom table name.
--runtime.telemetry.azure-log-analytics.auth.dcr-immutable-id Data Collection Rule ID.
--runtime.telemetry.azure-log-analytics.auth.dce-endpoint Data Collection Endpoint.
--runtime.telemetry.file.enabled Enable file sink telemetry.
--runtime.telemetry.file.path Path to log file.
--runtime.telemetry.file.rolling-interval Rolling interval.
--runtime.telemetry.file.retained-file-count-limit Max number of files retained.
--runtime.telemetry.file.file-size-limit-bytes Max size per file before rolling.
--help Display this help screen.
--version Display version information.

-c, --config

Path to the config file. Defaults to dab-config.json unless dab-config.<DAB_ENVIRONMENT>.json exists, where DAB_ENVIRONMENT is an environment variable.

Example

dab configure \
  --config ./dab-config.json \
  --runtime.rest.enabled true

--data-source.database-type

Database type.

Allowed values:

  • MSSQL
  • PostgreSQL
  • CosmosDB_NoSQL
  • MySQL

Example

dab configure \
  --data-source.database-type PostgreSQL

Resulting config

{
  "data-source": {
    "database-type": "postgresql"
  }
}

--data-source.connection-string

Connection string for the data source.

Example

dab configure \
  --data-source.connection-string "Server=myserver;Database=mydb;User Id=myuser;Password=mypassword;"

--data-source.options.database

Database name for Cosmos DB for NoSql.

Example

dab configure \
  --data-source.options.database MyCosmosDatabase

--data-source.options.container

Container name for Cosmos DB for NoSql.

Example

dab configure \
  --data-source.options.container MyCosmosContainer

--data-source.options.schema

Schema path for Cosmos DB for NoSql.

Example

dab configure \
  --data-source.options.schema ./schema.gql

--data-source.options.set-session-context

Enable session context.

Allowed values:

  • true (default)
  • false

Example

dab configure \
  --data-source.options.set-session-context false

Resulting config

{
  "data-source": {
    "options": {
      "set-session-context": false
    }
  }
}

--runtime.graphql.depth-limit

Max allowed depth of the nested query.

Allowed values:

  • $(0,2147483647]$ (inclusive)
  • -1 to remove limit

Example

dab configure \
  --runtime.graphql.depth-limit 3

Resulting config

{
  "runtime": {
    "graphql": {
      "depth-limit": 3
    }
  }
}

--runtime.graphql.enabled

Enable DAB's GraphQL endpoint.

Example

dab configure \
  --runtime.graphql.enabled false

--runtime.graphql.path

Customize DAB's GraphQL endpoint path. Prefix path with /.

Example

dab configure \
  --runtime.graphql.path /graphql

--runtime.graphql.allow-introspection

Allow or deny GraphQL introspection requests.

Example

dab configure \
  --runtime.graphql.allow-introspection false

--runtime.graphql.multiple-mutations.create.enabled

Enable or disable multiple-mutation create operations in the generated GraphQL schema.

Example

dab configure \
  --runtime.graphql.multiple-mutations.create.enabled true

--runtime.rest.enabled

Enable DAB's REST endpoint.

Example

dab configure \
  --runtime.rest.enabled false

--runtime.rest.path

Customize DAB's REST endpoint path. Prefix path with /.

Example

dab configure \
  --runtime.rest.path /myapi

Resulting config

{
  "runtime": {
    "rest": {
      "path": "/myapi"
    }
  }
}

--runtime.rest.request-body-strict

Prohibit extraneous REST request body fields.

Example

dab configure \
  --runtime.rest.request-body-strict true

--runtime.mcp.enabled

Enable DAB's MCP endpoint.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.enabled false

Resulting config

{
  "runtime": {
    "mcp": {
      "enabled": false
    }
  }
}

--runtime.mcp.path

Customize DAB's MCP endpoint path. Prefix path with /.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.path /mcp2

Resulting config

{
  "runtime": {
    "mcp": {
      "path": "/mcp2"
    }
  }
}

--runtime.mcp.dml-tools.enabled

Enable DAB's MCP DML tools endpoint.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.enabled false

--runtime.mcp.dml-tools.describe-entities.enabled

Enable DAB's MCP describe entities tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.describe-entities.enabled false

--runtime.mcp.dml-tools.create-record.enabled

Enable DAB's MCP create record tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.create-record.enabled false

--runtime.mcp.dml-tools.read-records.enabled

Enable DAB's MCP read record tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.read-records.enabled false

--runtime.mcp.dml-tools.update-record.enabled

Enable DAB's MCP update record tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.update-record.enabled false

--runtime.mcp.dml-tools.delete-record.enabled

Enable DAB's MCP delete record tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.delete-record.enabled false

--runtime.mcp.dml-tools.execute-entity.enabled

Enable DAB's MCP execute entity tool.

Note

This option is available only in the v1.7 prerelease CLI (currently RC). Install with dotnet tool install microsoft.dataapibuilder --prerelease.

Example

dab configure \
  --runtime.mcp.dml-tools.execute-entity.enabled false

--runtime.cache.enabled

Enable DAB's cache globally. You must also enable caching for each entity.

Example

dab configure \
  --runtime.cache.enabled true

Resulting config

{
  "runtime": {
    "cache": {
      "enabled": true
    }
  }
}

--runtime.cache.ttl-seconds

Customize the DAB cache's global default time to live in seconds.

Example

dab configure \
  --runtime.cache.ttl-seconds 30

Resulting config

{
  "runtime": {
    "cache": {
      "enabled": false,
      "ttl-seconds": 30
    }
  }
}

--runtime.host.mode

Set the host running mode of DAB.

Allowed values:

  • Development
  • Production

Example

dab configure \
  --runtime.host.mode Development

Resulting config

{
  "runtime": {
    "host": {
      "mode": "development"
    }
  }
}

--runtime.host.cors.origins

Overwrite allowed origins in CORS. Provide values as a space-separated list.

Example

dab configure \
  --runtime.host.cors.origins \
  https://contoso.com \
  https://fabrikam.com

Resulting config

{
  "runtime": {
    "host": {
      "cors": {
        "origins": [
          "https://contoso.com",
          "https://fabrikam.com"
        ]
      }
    }
  }
}

--runtime.host.cors.allow-credentials

Set the value for the Access-Control-Allow-Credentials header.

Example

dab configure \
  --runtime.host.cors.allow-credentials true

--runtime.host.authentication.provider

Configure the name of authentication provider.

Example

dab configure \
  --runtime.host.authentication.provider AppService

--runtime.host.authentication.jwt.audience

Configure the intended recipient(s) of the JWT token.

Example

dab configure \
  --runtime.host.authentication.jwt.audience api://my-app

--runtime.host.authentication.jwt.issuer

Configure the entity that issued the JWT token.

Example

dab configure \
  --runtime.host.authentication.jwt.issuer https://login.microsoftonline.com/common/v2.0

Resulting config

{
  "runtime": {
    "host": {
      "authentication": {
        "provider": "AppService",
        "jwt": {
          "audience": "api://my-app",
          "issuer": "https://login.microsoftonline.com/common/v2.0"
        }
      }
    }
  }
}

--azure-key-vault.endpoint

Configure the Azure Key Vault endpoint URL.

Example

dab configure \
  --azure-key-vault.endpoint https://my-vault.vault.azure.net

--azure-key-vault.retry-policy.mode

Configure the retry policy mode.

Allowed values:

  • fixed
  • exponential

Example

dab configure \
  --azure-key-vault.retry-policy.mode fixed

--azure-key-vault.retry-policy.max-count

Configure the maximum number of retry attempts.

Example

dab configure \
  --azure-key-vault.retry-policy.max-count 5

--azure-key-vault.retry-policy.delay-seconds

Configure the initial delay between retries in seconds.

Example

dab configure \
  --azure-key-vault.retry-policy.delay-seconds 2

--azure-key-vault.retry-policy.max-delay-seconds

Configure the maximum delay between retries in seconds (for exponential mode).

Example

dab configure \
  --azure-key-vault.retry-policy.max-delay-seconds 30

--azure-key-vault.retry-policy.network-timeout-seconds

Configure the network timeout for requests in seconds.

Example

dab configure \
  --azure-key-vault.retry-policy.network-timeout-seconds 20

Resulting config

{
  "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

Enable or disable Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.enabled true

--runtime.telemetry.azure-log-analytics.dab-identifier

Configure a DAB identifier string used in Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.dab-identifier MyDab

--runtime.telemetry.azure-log-analytics.flush-interval-seconds

Configure flush interval in seconds for Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.flush-interval-seconds 10

--runtime.telemetry.azure-log-analytics.auth.custom-table-name

Configure custom table name for Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.auth.custom-table-name MyDabLogs

--runtime.telemetry.azure-log-analytics.auth.dcr-immutable-id

Configure DCR immutable ID for Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.auth.dcr-immutable-id dcr-123

--runtime.telemetry.azure-log-analytics.auth.dce-endpoint

Configure DCE endpoint for Azure Log Analytics.

Example

dab configure \
  --runtime.telemetry.azure-log-analytics.auth.dce-endpoint https://example.eastus-1.ingest.monitor.azure.com

Resulting config

{
  "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

Enable or disable file sink logging.

Example

dab configure \
  --runtime.telemetry.file.enabled true

--runtime.telemetry.file.path

Configure path for file sink logging.

Example

dab configure \
  --runtime.telemetry.file.path C:\\logs\\dab-log.txt

--runtime.telemetry.file.rolling-interval

Configure rolling interval for file sink logging.

Allowed values:

  • Minute
  • Hour
  • Day
  • Month
  • Year
  • Infinite

Example

dab configure \
  --runtime.telemetry.file.rolling-interval Month

--runtime.telemetry.file.retained-file-count-limit

Configure maximum number of retained files.

Example

dab configure \
  --runtime.telemetry.file.retained-file-count-limit 5

--runtime.telemetry.file.file-size-limit-bytes

Configure maximum file size limit in bytes.

Example

dab configure \
  --runtime.telemetry.file.file-size-limit-bytes 2097152

Resulting config

{
  "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

Display this help screen.

Example

dab configure \
  --help

--version

Display version information.

Example

dab configure \
  --version