Skip to content

Conversation

@catalina-gav
Copy link
Contributor

📥 Pull Request

❓ What are you trying to address

Onboard new fabric_map data source and resource.

This closes #773 and #774

Copilot AI review requested due to automatic review settings December 16, 2025 16:28
@catalina-gav catalina-gav requested a review from a team as a code owner December 16, 2025 16:28
@github-actions
Copy link

🛑 Changelog entry required to merge

Run changie new to add a new changelog entry

Copy link
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

This PR adds support for the fabric_map resource and associated data sources (fabric_map and fabric_maps) to the Terraform provider. The implementation follows the established pattern for Fabric items with definition support.

Key changes:

  • New resource fabric_map for managing Fabric Map items with optional definition management
  • New data sources fabric_map and fabric_maps for querying Map items
  • Comprehensive test coverage including unit and acceptance tests

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/services/maps/base.go Defines core constants and configuration for Map item type
internal/services/maps/resource_map.go Implements the Map resource with definition validation
internal/services/maps/data_map.go Implements single Map data source
internal/services/maps/data_maps.go Implements list Maps data source
internal/services/maps/*_test.go Test files for resource and data sources
internal/provider/provider.go Registers new Map resource and data sources
examples/* Example configurations and documentation
docs/* Generated documentation for resource and data sources

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

Type: "map",
Names: "Maps",
Types: "maps",
DocsURL: "https://learn.microsoft.com/azure/azure-maps/",
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The DocsURL appears to reference Azure Maps (mapping/geospatial service) rather than Fabric Maps. This should point to Fabric-specific Map documentation if this is a different type of 'Map' item in Fabric. If these are the same, consider clarifying in comments to avoid confusion.

Suggested change
DocsURL: "https://learn.microsoft.com/azure/azure-maps/",
DocsURL: "https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/map-definition",

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +28
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The definition key used is 'content.json' but according to the schema documentation and base.go, the Map definition path is 'map.json', not 'content.json'. This example will not work correctly.

Suggested change
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content).payload

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +28
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The definition key should be 'map.json' to match the configured definition path, not 'content.json'.

Suggested change
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content).payload

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +49
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The definition path key should be 'map.json' as specified in the schema, not 'content.json'.

Suggested change
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content).payload

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +49
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The definition path key should be 'map.json' to match the actual definition format paths.

Suggested change
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["map.json"].content).payload

Copilot uses AI. Check for mistakes.
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] Add Map Data Source

2 participants