Skip to content

[DS] fabric_data_agent #896

@OrBaubergMicrosoft

Description

@OrBaubergMicrosoft

📝 Description

When managing Microsoft Fabric infrastructure as code,
I want to read existing Data Agent resources via Terraform data sources,
so I can reference Data Agent configurations in my Terraform plans without managing their lifecycle.

Related resource issue: #895

🔬 Details / References

  • Data Source Name: fabric_data_agent (singular) / fabric_data_agents (plural list)
  • API documentation:
  • Definition article: https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/data-agent-definition
  • SDK Package: github.com/microsoft/fabric-sdk-go/fabric/dataagent (import alias: fabdataagent)
  • ItemType Constant: fabcore.ItemTypeDataAgent ("DataAgent")
  • Item Archetype: definition-properties
  • Definition format: JSON
  • Definition Paths:
    • Files/Config/data_agent.json (format: JSON) — required — top-level data agent configuration
    • Files/Config/draft/stage_config.json (format: JSON) — required — stage configuration (AI instructions)
    • Files/Config/draft/{dataSourceType}-{dataSourceName}/datasource.json (format: JSON) — optional — data source configuration
    • Files/Config/draft/{dataSourceType}-{dataSourceName}/fewshots.json (format: JSON) — optional — few shot examples
    • Files/Config/publish_info.json (format: JSON) — optional — publish info (if published)
    • Files/Config/published/stage_config.json (format: JSON) — optional — published stage configuration
    • Files/Config/published/{dataSourceType}-{dataSourceName}/datasource.json (format: JSON) — optional
    • Files/Config/published/{dataSourceType}-{dataSourceName}/fewshots.json (format: JSON) — optional
  • Estimated complexity/effort: moderate
  • Preview: no
  • SPN Supported: yes
  • Related resources/data-sources:

🚧 Potential Terraform Configuration

# Singular data source — look up by ID or display_name
data "fabric_data_agent" "example" {
  display_name = "example"
  workspace_id = fabric_workspace.example.id
}

# Plural data source — list all Data Agents in a workspace
data "fabric_data_agents" "all" {
  workspace_id = fabric_workspace.example.id
}

☑️ Acceptance Criteria

  • Can read Data Agent by ID
  • Can read Data Agent by display_name
  • Can list all Data Agents in a workspace
  • Properties (one_lake_root_path) are correctly mapped from SDK response

✅ Definition of Done

  • Data Transfer Objects (DTOs)
  • Data-Source Implementation (singular + plural)
  • Data-Source Added to Provider
  • Unit Tests for Happy path
  • Unit Tests for Error path
  • Acceptance Tests
  • Example in the ./examples folder
  • Schema documentation in code
  • Updated auto-generated provider docs with task docs

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions