Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

Why make this change?

The data-source.health.name property exists in the DAB schema but was not exposed as a CLI parameter, making it impossible to configure via command line.

What is this change?

Added --data-source.health.name CLI parameter to the dab configure command.

Implementation details:

  • Added DataSourceHealthName parameter to ConfigureOptions with CLI option binding
  • Extended TryUpdateConfiguredDataSourceOptions to create or update health configuration while preserving existing settings
  • Modified DatasourceHealthOptionsConvertorFactory.Write() to serialize health object when name is set (previously only serialized when enabled was explicitly provided)

How was this tested?

  • Unit Tests
    • TestAddDataSourceHealthName - validates adding name to config without health section
    • TestUpdateDataSourceHealthName - validates updating name while preserving existing health settings

Sample Request(s)

CLI usage:

# Add health name to a new or existing config
dab configure --data-source.health.name "Production SQL Server" -c dab-config.json

Result:

{
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env('MSSQL_CONNECTION_STRING')",
    "health": {
      "enabled": true,
      "name": "Production SQL Server"
    }
  }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: dab configure --data-source.health.name is missing.</issue_title>
<issue_description>### What happened?

The data-source.health.name property exists in the DAB schema but isn't exposed as a CLI parameter

Target configuration:

{
  "$schema": "https://github.com/Azure/data-api-builder/releases/download/v1.7.81/dab.draft.schema.json",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env('MSSQL_CONNECTION_STRING')",
    "health": {
      "name": "This is the value" // here
    }
  }
}

Version

Microsoft.DataApiBuilder 1.7.81

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

No response

Relevant log output

> dab configure --data-source.health.name my data source -c "dab-config-4.json"

Microsoft.DataApiBuilder 1.7.81-rc+c7927fa9885160ed35bcc9b25b13fd59b88f3133
c Microsoft Corporation. All rights reserved.

ERROR(S):
  Option 'data-source.health.name' is unknown.

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 14, 2026 04:57
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CLI parameter for data-source.health.name Add CLI parameter for data-source.health.name Jan 14, 2026
Copilot AI requested a review from JerryNixon January 14, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: dab configure --data-source.health.name is missing.

2 participants