Skip to content

[Bug]: Critical! Default image config is not usable. #3593

@JerryNixon

Description

@JerryNixon

Expected

Pull 2.0.1-RC and set DAB_CONNSTRING environment variable and auto-config takes over and works.

{
  "$schema": "https://github.com/Azure/data-api-builder/releases/download/2.0.1-RC/dab.draft.schema.json",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env('DAB_CONNSTRING')"
  },
  "runtime": {
    "rest": { "request-body-strict": false },
    "host": {
      "mode": "development",
      "authentication": { "provider": "Unauthenticated" },
      "cors": { "origins": ["*"], "allow-credentials": false }
    }
  },
  "autoentities": {
    "default": {
      "patterns": {
        "include": ["%.%"],
        "name": "{schema}_{object}"
      },
      "permissions": [{ "role": "anonymous", "actions": ["*"] }]
    }
  }
}

Actual

Existing default schema has things (like entities) that make it unusable.

  1. Should default database-type to mssql.
  2. connection-string should be ""
  3. data-source.options should be omited.
  4. request-body-strict should be false
  5. authentication.provider should be anonymous
  6. cors.origins should be *
  7. entities should be omitted (this is the root of the failure)
  8. autoentities should be %.% (this is the other root of the error)
{
  "data-source": {
    "database-type": "@env('db-type')",
    "connection-string": "@env('ConnectionStrings__Database')",
    "options": {
      "set-session-context": false
    }
  },
  "runtime": {
    "rest": {
      "enabled": true,
      "path": "/api",
      "request-body-strict": true
    },
    "graphql": {
      "enabled": true,
      "path": "/graphql",
      "allow-introspection": true
    },
    "host": {
      "authentication": {
        "provider": "StaticWebApps"
      },
      "cors": {
        "origins": [],
        "allow-credentials": false
      },
      "mode": "development"
    },
    "telemetry": {
      "open-telemetry": {
        "enabled": true,
        "endpoint": "@env('OTEL_EXPORTER_OTLP_ENDPOINT')",
        "headers": "@env('OTEL_EXPORTER_OTLP_HEADERS')",
        "exporter-protocol": "@env('OTEL_EXPORTER_OTLP_PROTOCOL')",
        "service-name": "@env('OTEL_SERVICE_NAME')"
      }
    },
    "cache": {
      "enabled": true,
      "ttl-seconds": 60
    }
  },
  "entities": {
    "Actor": {
      "source": {
        "object": "Actor",
        "type": "table"
      },
      "graphql": {
        "enabled": true,
        "type": {
          "singular": "Actor",
          "plural": "Actors"
        }
      },
      "rest": {
        "enabled": true
      },
      "permissions": [
        {
          "role": "anonymous",
          "actions": ["*"]
        }
      ],
      "relationships": {
        "character": {
          "cardinality": "many",
          "target.entity": "Character",
          "source.fields": ["Id"],
          "target.fields": ["ActorId"],
          "linking.source.fields": [],
          "linking.target.fields": []
        }
      }
    },
    "Character": {
      "source": {
        "object": "Character",
        "type": "table"
      },
      "graphql": {
        "enabled": true,
        "type": {
          "singular": "Character",
          "plural": "Characters"
        }
      },
      "rest": {
        "enabled": true
      },
      "permissions": [
        {
          "role": "anonymous",
          "actions": [{ "action": "*" }]
        }
      ],
      "relationships": {
        "actor": {
          "cardinality": "one",
          "target.entity": "Actor",
          "source.fields": ["ActorId"],
          "target.fields": ["Id"],
          "linking.source.fields": [],
          "linking.target.fields": []
        },
        "series": {
          "cardinality": "many",
          "target.entity": "Series",
          "source.fields": ["Id"],
          "target.fields": ["Id"],
          "linking.object": "series_character",
          "linking.source.fields": ["CharacterId"],
          "linking.target.fields": ["SeriesId"]
        }
      }
    },
    "Series": {
      "source": {
        "object": "Series",
        "type": "table"
      },
      "graphql": {
        "enabled": true,
        "type": {
          "singular": "Series",
          "plural": "Series"
        }
      },
      "rest": {
        "enabled": true
      },
      "permissions": [
        {
          "role": "anonymous",
          "actions": [{ "action": "*" }]
        }
      ],
      "relationships": {
        "character": {
          "cardinality": "many",
          "target.entity": "Character",
          "source.fields": ["Id"],
          "target.fields": ["Id"],
          "linking.object": "series_character",
          "linking.source.fields": ["SeriesId"],
          "linking.target.fields": ["CharacterId"]
        }
      }
    },
    "Species": {
      "source": {
        "object": "Species",
        "type": "table"
      },
      "graphql": {
        "enabled": true,
        "type": {
          "singular": "Species",
          "plural": "Species"
        }
      },
      "rest": {
        "enabled": true
      },
      "permissions": [
        {
          "role": "anonymous",
          "actions": [{ "action": "*" }]
        }
      ],
      "relationships": {
        "character": {
          "cardinality": "many",
          "target.entity": "Character",
          "source.fields": ["Id"],
          "target.fields": ["Id"],
          "linking.object": "character_species",
          "linking.source.fields": ["SpeciesId"],
          "linking.target.fields": ["CharacterId"]
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Review In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions