Skip to content

feat(operations_agent): onboard new Operations Agent resource and data source #911

Open
catalina-gav wants to merge 6 commits intomainfrom
dev/catalinagav/onboard-operations-agent
Open

feat(operations_agent): onboard new Operations Agent resource and data source #911
catalina-gav wants to merge 6 commits intomainfrom
dev/catalinagav/onboard-operations-agent

Conversation

@catalina-gav
Copy link
Copy Markdown
Contributor

📥 Pull Request

❓ What are you trying to address

Close #899
Close #900

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Changelog Preview

v1.9.2-dev - April 28, 2026

✨ Added

  • #765 Added shortcut_conflict_policy attribute to fabric_shortcut resource
  • #900 Added fabric_operations_agent data source
  • #899 Added fabric_operations_agent resource
  • #896 Added fabric_data_agent Data Source
  • #895 Added fabric_data_agent Resource
  • #928 Added one_drive_share_point attribute to fabric_shortcut resource
  • #929 Added one_drive_share_point attribute to fabric_shortcut data source

🪲 Fixed

  • #892 Fixed fabric_shortcut azure_blob_storage documentation
  • #910 Fixed an issue where v1.9.0 could fail to install with OpenTofu due to a checksum mismatch; OpenTofu users should upgrade to v1.9.1 or later.
  • #926 Fixed fabric_shortcut import not working

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Terraform support for Microsoft Fabric Operations Agent items by introducing a new fabric_operations_agent resource plus singular/plural data sources, including provider registration, tests, examples, and generated documentation.

Changes:

  • Implement fabric_operations_agent resource (definition + properties) and register it in the provider.
  • Implement fabric_operations_agent and fabric_operations_agents data sources (read by id/name + list).
  • Add unit/acceptance tests, examples, fixtures, fake-server support, and generated docs/changelog entries.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
internal/testhelp/fixtures/operations_agent/Configurations.json.tmpl Adds an Operations Agent definition fixture for tests.
internal/testhelp/fakes/fake_server.go Registers Operations Agent handlers in the fake server.
internal/testhelp/fakes/fabric_operations_agent.go Adds fake Operations Agent entity + definition operations for unit tests.
internal/services/operationsagent/base.go Defines Operations Agent type info and supported definition formats/paths.
internal/services/operationsagent/base_test.go Wires shared type info/constants for operationsagent tests.
internal/services/operationsagent/models.go Adds Terraform model mapping for Operations Agent properties (state).
internal/services/operationsagent/schema_resource_operations_agent.go Defines resource-side properties.state schema.
internal/services/operationsagent/schema_data_operations_agent.go Defines data-source-side properties.state schema.
internal/services/operationsagent/resource_operations_agent.go Implements the Operations Agent resource using the shared fabricitem helpers.
internal/services/operationsagent/resource_operations_agent_test.go Adds unit + acceptance tests for Operations Agent resource CRUD + import + definition behavior.
internal/services/operationsagent/data_operations_agent.go Implements singular Operations Agent data source (by id or display_name, optional definition output).
internal/services/operationsagent/data_operations_agent_test.go Adds unit + acceptance tests for singular Operations Agent data source.
internal/services/operationsagent/data_operations_agents.go Implements plural Operations Agents data source (list).
internal/services/operationsagent/data_operations_agents_test.go Adds unit + acceptance tests for plural Operations Agents data source.
internal/provider/provider.go Registers the new resource and data sources with the provider.
examples/resources/fabric_operations_agent/resource.tf Adds resource usage examples (with and without definition).
examples/resources/fabric_operations_agent/providers.tf Adds provider setup for the resource examples.
examples/resources/fabric_operations_agent/outputs.tf Outputs the example resource.
examples/resources/fabric_operations_agent/import.sh Adds import example for the resource.
examples/data-sources/fabric_operations_agent/data-source.tf Adds singular data source examples (by id/name and with definition output).
examples/data-sources/fabric_operations_agent/providers.tf Adds provider setup for the singular data source examples.
examples/data-sources/fabric_operations_agent/outputs.tf Outputs the singular data source examples.
examples/data-sources/fabric_operations_agents/data-source.tf Adds plural data source example (list).
examples/data-sources/fabric_operations_agents/providers.tf Adds provider setup for the plural data source example.
examples/data-sources/fabric_operations_agents/outputs.tf Outputs the plural data source example.
docs/resources/operations_agent.md Adds generated documentation for the new resource.
docs/data-sources/operations_agent.md Adds generated documentation for the singular data source.
docs/data-sources/operations_agents.md Adds generated documentation for the plural data source.
.changes/unreleased/added-20260408-105129.yaml Changelog entry for the new resource.
.changes/unreleased/added-20260408-105059.yaml Changelog entry for the new data source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/testhelp/fakes/fabric_operations_agent.go
Comment thread internal/testhelp/fakes/fabric_operations_agent.go
Comment thread examples/resources/fabric_operations_agent/resource.tf
Comment thread examples/data-sources/fabric_operations_agent/data-source.tf
Comment thread docs/data-sources/operations_agent.md
Comment thread docs/resources/operations_agent.md
Comment thread internal/services/operationsagent/schema_resource_operations_agent.go Outdated
Comment thread internal/services/operationsagent/schema_data_operations_agent.go Outdated
Comment thread examples/resources/fabric_operations_agent/resource.tf
Comment thread internal/services/operationsagent/base.go Outdated
Comment thread examples/resources/fabric_operations_agent/import.sh Outdated
Comment thread internal/services/operationsagent/data_operations_agent_test.go Outdated
Comment thread internal/services/operationsagent/resource_operations_agent.go
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
github.com/microsoft/terraform-provider-fabric/internal/auth 84% 0
github.com/microsoft/terraform-provider-fabric/internal/common 100% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/customtypes 66% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/planmodifiers 53% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/typeutils 50% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/validators 69% 0
github.com/microsoft/terraform-provider-fabric/internal/functions 75% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/fabricitem 76% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/tftypeinfo 75% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/transforms 77% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/utils 84% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/client 91% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/config 100% 0
github.com/microsoft/terraform-provider-fabric/internal/provider 80% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/utils 63% 0
github.com/microsoft/terraform-provider-fabric/internal/services/activator 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/apacheairflowjob 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/capacity 84% 0
github.com/microsoft/terraform-provider-fabric/internal/services/connection 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/connectionra 71% 0
github.com/microsoft/terraform-provider-fabric/internal/services/copyjob 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/cosmosdb 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/dashboard 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/dataflow 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/datamart 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/datapipeline 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/deploymentpipeline 68% 0
github.com/microsoft/terraform-provider-fabric/internal/services/deploymentpipelinera 70% 0
github.com/microsoft/terraform-provider-fabric/internal/services/digitaltwinbuilder 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/digitaltwinbuilderflow 83% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domain 76% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domainra 64% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domainwa 71% 0
github.com/microsoft/terraform-provider-fabric/internal/services/environment 86% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventhouse 93% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventstream 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventstreamsourceconnection 83% 0
github.com/microsoft/terraform-provider-fabric/internal/services/externaldatashare 78% 0
github.com/microsoft/terraform-provider-fabric/internal/services/fabricmap 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/folder 75% 0
github.com/microsoft/terraform-provider-fabric/internal/services/gateway 79% 0
github.com/microsoft/terraform-provider-fabric/internal/services/gatewayra 55% 0
github.com/microsoft/terraform-provider-fabric/internal/services/graphqlapi 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/itemjobscheduler 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqldashboard 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqldatabase 87% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqlqueryset 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/lakehouse 86% 0
github.com/microsoft/terraform-provider-fabric/internal/services/lakehousetable 80% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mirroreddatabase 84% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mirroredwarehouse 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mlexperiment 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mlmodel 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mounteddatafactory 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/notebook 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/ontology 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/operationsagent 89% 0
github.com/microsoft/terraform-provider-fabric/internal/services/paginatedreport 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/report 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/semanticmodel 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/shortcut 78% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkcustompool 70% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkenvsettings 81% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkjobdefinition 89% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkwssettings 83% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sqldatabase 87% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sqlendpoint 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/tags 74% 0
github.com/microsoft/terraform-provider-fabric/internal/services/tenantsetting 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/variablelibrary 90% 0
github.com/microsoft/terraform-provider-fabric/internal/services/warehouse 91% 0
github.com/microsoft/terraform-provider-fabric/internal/services/warehousesnapshot 90% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspace 80% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacegit 69% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacegop 70% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacempe 77% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacencp 69% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspaceocr 77% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspaceogr 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacera 76% 0
Summary 76% (22389 / 29354) 0

Minimum allowed line rate is 40%

Comment thread examples/resources/fabric_operations_agent/resource.tf Outdated
}

func TestAcc_OperationsAgentsDataSource(t *testing.T) {
if testhelp.ShouldSkipTest(t) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there are no E2Es, can you try to make some operations with it manually (get, get definition and properties for DS, CRUD + definition manual cover for resource)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran the E2E tests locally without skipping them and they pass

Comment thread internal/services/operationsagent/resource_operations_agent_test.go
const (
FabricItemType = fabcore.ItemTypeOperationsAgent
ItemDefinitionEmpty = `{}`
ItemDefinitionEmpty = `{"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/operationsAgents/definition/1.0.0/schema.json","configuration": {"goals": "","instructions": "","dataSources": {},"actions": {}},"shouldRun": false}`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the schema be here? what about other items?

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.

[DS] fabric_operations_agent [RS] fabric_operations_agent

4 participants