Skip to content

🥕[Bug]: JSON Schema: Application Insights Connection String is Required #2516

@JerryNixon

Description

@JerryNixon

The application-insights section of the configuration requires a connection-string whenever the section exists, even if "enabled": false. The property is usually missing entirely in most configurations, but as soon as you include the application-insights block, even with telemetry disabled, the schema forces you to provide a connection-string. This makes no sense for developers trying to opt out of telemetry cleanly.

Example

This configuration is invalid though it should be valid.

{
  "telemetry": {
    "application-insights": {
      "enabled": false
    }
  }
}

Instead, this is required. A silly friction for the developer.

{
  "telemetry": {
    "application-insights": {
      "enabled": false,
      "connection-string": "dummy-value"
    }
  }
}

Recommendation

Fix the schema so connection-string is only required when enabled is true.

{
  "if": {
    "properties": { "enabled": { "const": true } }
  },
  "then": {
    "required": ["connection-string"]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions