Azure / Azure/data-api-builder

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

Open
#2,516 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

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.

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

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

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

## Recommendation

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

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.