Skip to content

Conversation

@brandonhawi
Copy link

@brandonhawi brandonhawi commented Jan 12, 2026

Changes

Adds a dedicated azure-openai provider and azure_openai_config block to databricks_model_serving.

Why: The current openai provider mixes native and Azure fields, making it impossible to enforce Azure-specific requirements at the schema level.

Technical Reasoning:
The databricks-sdk-go is auto-generated from Databricks OpenAPI specs and cannot be modified directly. This PR implements a provider-side shim to translate the azure_openai_config HCL into SDK-native openai_config structures at runtime, delivering better DevEx without requiring backend API schema changes.

Implementation Details:

  • Uses AddNewField via CustomizeSchemaPath to extend the schema robustly.
  • Implements plan-time deprecation warnings for legacy Azure-on-OpenAI configurations.
  • Handles state transformation during import to prevent immediate drift.

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance (TestAccModelServingAzureOpenAI)
  • covered with unit tests in serving/resource_model_serving_test.go (TestModelServingCreateAzureOpenAI)
  • using Go SDK
  • has entry in NEXT_CHANGELOG.md file

@brandonhawi brandonhawi requested review from a team as code owners January 12, 2026 20:15
@brandonhawi brandonhawi requested review from parthban-db and removed request for a team January 12, 2026 20:15
@brandonhawi brandonhawi changed the title feat: Add explicit support for Azure OpenAI provider feat: Clarify Azure OpenAI configuration in model serving provider Jan 12, 2026
@brandonhawi brandonhawi marked this pull request as draft January 12, 2026 20:41
@brandonhawi brandonhawi force-pushed the azure-openai-provider branch from ddfa9cc to 7393413 Compare January 12, 2026 20:43
…tation

This commit fixes three critical issues identified in code review:

1. Silent Failure Prevention: Changed index boundary checks to return
   errors instead of silently continuing when served_entities index
   mismatches occur, preventing incomplete endpoint configurations.

2. Nil Pointer Safety: Added explicit nil check for ServedEntities
   in handleAzureOpenAI to prevent potential nil pointer dereference.

3. State Corruption Prevention: Modified handleAzureOpenAIRead to only
   transform openai -> azure-openai provider when azure_openai_config
   already exists in state, preventing state corruption for existing
   users with manual Azure configurations.

These changes improve error handling, prevent silent failures, and
maintain backwards compatibility with existing configurations.
- Add DiffSuppressFunc for plaintext secrets to prevent perpetual drift
- Refactor handleAzureOpenAIRead to prevent partial state corruption
- Improve error handling to catch malformed configurations early
- Add comprehensive unit tests for error cases
- Remove ConflictsWith constraints that don't work with nested lists

Runtime validation now enforces mutual exclusion between authentication methods.
@brandonhawi brandonhawi force-pushed the azure-openai-provider branch from 2158150 to 41a3dfb Compare January 12, 2026 21:54
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 5310
  • Commit SHA: c13de513a486570b243ca8fe36c5028745220a26

Checks will be approved automatically on success.

@brandonhawi brandonhawi marked this pull request as ready for review January 12, 2026 22:33
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.

1 participant