### Daily Configuration Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/item_job_scheduler.md Sets up a job scheduler for daily execution. Requires start and end times, type 'Daily', and a list of times for execution. ```terraform resource "fabric_item_job_scheduler" "daily_configuration_example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" job_type = "Execute" enabled = true #or false configuration = { start_date_time = "2025-11-11T10:00:00Z" end_date_time = "2025-11-12T10:00:00Z" type = "Daily" times = ["10:00"] } } ``` -------------------------------- ### Install Go on Ubuntu/Debian Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs the Go programming language by downloading the latest version, extracting it, and configuring environment variables. Ensure jq is installed for parsing JSON. ```shell goVersion=$(curl https://go.dev/dl/?mode=json | jq -r '.[0].version') curl -LO https://go.dev/dl/$goVersion.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local/ -xzf $goVersion.linux-amd64.tar.gz rm -f $goVersion.linux-amd64.tar.gz echo 'export PATH="$PATH:/usr/local/go/bin"' | sudo tee /etc/profile.d/go-lang.sh >/dev/null echo 'export GOROOT=/usr/local/go' >>~/.bashrc echo 'export GOPATH=$HOME/go' >>~/.bashrc echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >>~/.bashrc source ~/.bashrc ``` -------------------------------- ### Install Terraform on Ubuntu/Debian Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Adds the HashiCorp GPG key and repository, then installs Terraform using apt. ```shell wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list sudo apt update && sudo apt install terraform ``` -------------------------------- ### Install Go Version with goenv Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Use the go-nv/goenv tool to install a specific Go version, recommended for local development. ```shell goenv install 1.24.4 ``` -------------------------------- ### Monthly Configuration (Day of Month) Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/item_job_scheduler.md Sets up a monthly job scheduler based on the day of the month. Requires start and end times, type 'Monthly', recurrence, and occurrence details. ```terraform resource "fabric_item_job_scheduler" "monthly_configuration_day_of_month_example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" job_type = "Execute" enabled = true #or false configuration = { start_date_time = "2025-11-11T10:00:00Z" end_date_time = "2025-11-12T10:00:00Z" type = "Monthly" times = ["10:00"] recurrence = 1 occurrence = { occurrence_type = "DayOfMonth" day_of_month = 10 } } } ``` -------------------------------- ### Install Development Tools via Winget on Windows Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs Go, Terraform, and Task using the Windows Package Manager (winget). ```powershell winget install GoLang.Go Hashicorp.Terraform Task.Task ``` -------------------------------- ### Install Task on Ubuntu/Debian Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs the Task automation tool using a shell script. ```shell sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin ``` -------------------------------- ### Install Git on Ubuntu/Debian Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs the Git version control system using apt package manager. ```shell sudo apt update && sudo apt install git ``` -------------------------------- ### Data Agent with definition bootstrapping only Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/data_agent.md This example demonstrates bootstrapping a Data Agent's definition without enabling updates. It's useful for initial setup where the definition is static. ```terraform resource "fabric_data_agent" "example_definition_bootstrap" { display_name = "example" description = "example with definition bootstrapping" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false definition = { "Files/Config/data_agent.json" = { source = "${local.path}/data_agent.json.tmpl" } "Files/Config/draft/stage_config.json" = { source = "${local.path}/stage_config.json.tmpl" } } } ``` -------------------------------- ### Install Markdown Linter Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs the markdownlint tool using the Task automation tool. ```shell task install:markdownlint ``` -------------------------------- ### Weekly Configuration Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/item_job_scheduler.md Configures a job scheduler for weekly execution. Includes start and end times, type 'Weekly', specific times, and days of the week. ```terraform resource "fabric_item_job_scheduler" "weekly_configuration_example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" job_type = "Execute" enabled = true #or false configuration = { start_date_time = "2025-11-11T10:00:00Z" end_date_time = "2025-11-12T10:00:00Z" type = "Weekly" times = ["10:00"] weekdays = ["Monday"] } } ``` -------------------------------- ### Example Usage of fabric_deployment_pipelines Data Source Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/deployment_pipelines.md This snippet shows how to use the fabric_deployment_pipelines data source to retrieve a list of deployment pipelines. No specific setup is required beyond having the provider configured. ```terraform data "fabric_deployment_pipelines" "example" {} ``` -------------------------------- ### Cron Configuration Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/item_job_scheduler.md Configures a job scheduler with a Cron-based schedule. Specify start and end times, type as 'Cron', and an interval. ```terraform resource "fabric_item_job_scheduler" "cron_configuration_example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" job_type = "Execute" enabled = true #or false configuration = { start_date_time = "2025-11-11T10:00:00Z" end_date_time = "2025-11-12T10:00:00Z" type = "Cron" interval = 10 } } ``` -------------------------------- ### Go File Header Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/CODING_GUIDELINES.md All .go files must start with this copyright and license header. ```go // Copyright Microsoft Corporation 2026 // SPDX-License-Identifier: MPL-2.0 ``` -------------------------------- ### Import fabric_deployment_pipeline Resource Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/deployment_pipeline.md Example of how to import an existing fabric_deployment_pipeline resource using its ID. ```shell # terraform import fabric_deployment_pipeline.example "" terraform import fabric_deployment_pipeline.example "00000000-0000-0000-0000-000000000000" ``` -------------------------------- ### fabric_deployment_pipeline Resource Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/deployment_pipeline.md Example of how to declare a fabric_deployment_pipeline resource with display name, description, and stages. Stages can include workspace assignments. ```terraform resource "fabric_deployment_pipeline" "example" { display_name = "Deployment Pipeline Example" description = "Deployment Pipeline Example" stages = [ { display_name = "Stage 1", description = "Stage 1", is_public = true, workspace_id = "00000000-0000-0000-0000-000000000000" }, { display_name = "Stage 2", description = "Stage 2", is_public = false, } ] } ``` -------------------------------- ### Install Development Tools via Chocolatey on Windows Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Installs Go, Terraform, and Task using the Chocolatey package manager and refreshes environment variables. ```powershell choco install golang terraform go-task -y refreshenv ``` -------------------------------- ### Example: Mirrored Database with Definition Update Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/mirrored_database.md This example demonstrates updating a mirrored database definition when the source or tokens change. It requires a valid `workspace_id` and a `definition` map with source and tokens. ```terraform resource "fabric_mirrored_database" "example_definition_update" { display_name = "example3" description = "example with definition update when source or tokens changed" workspace_id = "00000000-0000-0000-0000-000000000000" format = "Default" definition = { "mirroring.json" = { source = "${local.path}/mirroring.json.tmpl" tokens = { "DEFAULT_SCHEMA" = "my_schema" } } } } ``` -------------------------------- ### fabric_folder Data Source Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/folder.md This example demonstrates how to retrieve details of a Fabric Folder using its ID and workspace ID. Ensure Service Principal authentication is configured and preview mode is enabled for the provider. ```terraform data "fabric_folder" "example_by_id" { id = "11111111-1111-1111-1111-111111111111" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Example Usage of fabric_kql_dashboards Data Source Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/kql_dashboards.md This example shows how to use the fabric_kql_dashboards data source to retrieve a list of KQL Dashboards within a specified workspace. Ensure you have the workspace ID available. ```terraform data "fabric_kql_dashboards" "example" { workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Install Terraform Version with tfenv Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Utilize the tfutils/tfenv tool to install and manage specific Terraform versions, recommended for local development. ```shell tfenv install 1.12.2 tfenv use 1.12.2 ``` -------------------------------- ### ShareableCloud Connection Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/connection.md Example of creating a ShareableCloud connection with FTP details and basic credentials. ```APIDOC ## fabric_connection ShareableCloud Connection ### Description Manages a ShareableCloud type Fabric Connection. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **display_name** (string) - Required - The display name for the connection. - **connectivity_type** (string) - Required - The type of connectivity. - **privacy_level** (string) - Required - The privacy level of the connection. - **allow_usage_in_user_controlled_code** (bool) - Optional - Whether usage in user-controlled code is allowed. - **connection_details** (object) - Required - Details about the connection. - **type** (string) - Required - The type of connection. - **creation_method** (string) - Required - The creation method for the connection. - **parameters** (list of objects) - Optional - Parameters for the connection. - **name** (string) - Required - The name of the parameter. - **value** (string) - Required - The value of the parameter. - **credential_details** (object) - Required - Details about the credentials. - **connection_encryption** (string) - Required - The encryption method for the connection. - **credential_type** (string) - Required - The type of credential. - **single_sign_on_type** (string) - Required - The single sign-on type. - **skip_test_connection** (bool) - Optional - Whether to skip testing the connection. - **basic_credentials** (object) - Required if credential_type is Basic - Basic authentication credentials. - **username** (string) - Required - The username for basic authentication. - **password_wo** (string) - Required - The password for basic authentication. - **password_wo_version** (int) - Required - The version of the password. ### Request Example ```terraform resource "fabric_connection" "example_cloud" { display_name = "example" connectivity_type = "ShareableCloud" privacy_level = "Organizational" allow_usage_in_user_controlled_code = true connection_details = { type = "FTP" creation_method = "FTP.Contents" parameters = [ { name = "server" value = "ftp.example.com" } ] } credential_details = { connection_encryption = "NotEncrypted" credential_type = "Basic" single_sign_on_type = "None" skip_test_connection = false basic_credentials = { username = "user" password_wo = "...secret_password..." password_wo_version = 1 } } } ``` ### Response #### Success Response (200) Schema not provided in source. #### Response Example None provided in source. ``` -------------------------------- ### Setup Well-Known Resources for Acceptance Tests Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Run this command after setting the required environment variables to set up the well-known resources needed for acceptance tests. ```shell task testacc:setup ``` -------------------------------- ### Basic Spark Job Definition Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/spark_job_definition.md Example of creating a Spark Job Definition without a specific definition file. This is useful for initial setup or when the definition is managed separately. ```terraform resource "fabric_spark_job_definition" "example" { display_name = "example1" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Retrieve a list of Fabric Capacities Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/capacities.md Use this data source to get a list of all available Fabric Capacities in your environment. No specific setup is required beyond the standard Terraform configuration. ```terraform data "fabric_capacities" "example" {} ``` -------------------------------- ### Create Shortcut KQL Database with Invitation Token (Write-only Arguments) Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/kql_database.md Create a Shortcut KQL database using an invitation token. This example utilizes Terraform's write-only arguments for secure handling of the token, requiring Terraform 1.11 or later. ```terraform resource "fabric_kql_database" "example3" { display_name = "example3" workspace_id = "00000000-0000-0000-0000-000000000000" configuration = { database_type = "Shortcut" eventhouse_id = "11111111-1111-1111-1111-111111111111" invitation_token_wo = "eyJ0...InvitationToken...iJKV" invitation_token_wo_version = 1 } } ``` -------------------------------- ### Monthly Configuration (Ordinal Weekday) Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/item_job_scheduler.md Configures a monthly job scheduler based on an ordinal weekday. Includes start and end times, type 'Monthly', recurrence, and specific weekday occurrence. ```terraform resource "fabric_item_job_scheduler" "monthly_configuration_ordinal_weekday_example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" job_type = "Execute" enabled = true #or false configuration = { start_date_time = "2025-11-11T10:00:00Z" end_date_time = "2025-11-12T10:00:00Z" type = "Monthly" times = ["10:00"] recurrence = 1 occurrence = { occurrence_type = "OrdinalWeekday" week_index = "First" weekday = "Monday" } } } ``` -------------------------------- ### Retrieve Semantic Model Details Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/semantic_model.md Use this snippet to get basic details of a Semantic Model by providing its ID and the Workspace ID. No special setup is required beyond standard Terraform configuration. ```terraform data "fabric_semantic_model" "example" { id = "11111111-1111-1111-1111-111111111111" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Create a Shortcut KQL Database to Source Azure Data Explorer Cluster Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/kql_database.md This example demonstrates creating a Shortcut KQL database that sources data from an Azure Data Explorer cluster. It requires the source cluster URI and database name. ```terraform resource "fabric_kql_database" "example2" { display_name = "example2" workspace_id = "00000000-0000-0000-0000-000000000000" configuration = { database_type = "Shortcut" eventhouse_id = "11111111-1111-1111-1111-111111111111" source_cluster_uri = "https://clustername.westus.kusto.windows.net" source_database_name = "MyDatabase" } } ``` -------------------------------- ### Example: Mirrored Database with Definition Bootstrapping Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/mirrored_database.md Use this snippet to create a mirrored database with definition bootstrapping only. Ensure the `workspace_id` and `definition` map are correctly configured. ```terraform resource "fabric_mirrored_database" "example_definition_bootstrap" { display_name = "example2" description = "example with definition bootstrapping" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false format = "Default" definition = { "mirroring.json" = { source = "${local.path}/mirroring.json.tmpl" } } } ``` -------------------------------- ### Deploy a SQL project Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/sql_database.md This snippet shows how to deploy a SQL project by specifying the 'sqlproj' format and providing definitions for the project file and its contents. Ensure the source paths for definitions are correctly set. ```terraform resource "fabric_sql_database" "example_sqlproj" { display_name = "example_sqlproj" workspace_id = "00000000-0000-0000-0000-000000000000" format = "sqlproj" definition = { "definition.sqlproj" = { source = "${local.path}/definition.sqlproj.tmpl" } "dbo/Tables/TestTable.sql" = { source = "${local.path}/dbo/Tables/TestTable.sql.tmpl" } } } ``` -------------------------------- ### fabric_domain_role_assignments Resource Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/domain_role_assignments.md Example of how to configure a fabric_domain_role_assignments resource to assign roles to principals within a specific domain. ```terraform resource "fabric_domain_role_assignments" "example" { domain_id = "00000000-0000-0000-0000-000000000000" role = "Admins" principals = [ { id = "11111111-1111-1111-1111-111111111111" type = "User" }, { id = "22222222-2222-2222-2222-222222222222" type = "Group" } ] } ``` -------------------------------- ### Create a KQL Queryset with definition bootstrapping Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/kql_queryset.md This example shows how to create a KQL Queryset with a definition, but with updates disabled. It's useful for bootstrapping a definition from a source file without immediate modification. ```terraform resource "fabric_kql_queryset" "example_definition_bootstrap" { display_name = "example" description = "example with definition bootstrapping" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false format = "Default" definition = { "RealTimeQueryset.json" = { source = "${local.path}/RealTimeQueryset.json" } } } ``` -------------------------------- ### Run All Acceptance Tests Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Execute this command to run all acceptance tests. These tests create actual resources against real APIs. ```shell task testacc ``` -------------------------------- ### Create a new SQL database with default settings Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/sql_database.md Use this snippet to create a basic SQL database with default configurations. Ensure the workspace ID is provided. ```terraform resource "fabric_sql_database" "example" { display_name = "example" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Report bootstrapping only Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/report.md This example demonstrates bootstrapping a report using the PBIR-Legacy format. Set 'definition_update_enabled' to false to prevent updates. The 'tokens' block allows for templated values in the definition files. ```terraform resource "fabric_report" "example_bootstrap" { display_name = "example" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false format = "PBIR-Legacy" definition = { "report.json" = { source = "${local.path}/report.json" } "definition.pbir" = { source = "${local.path}/definition.pbir.tmpl" tokens = { "SemanticModelID" = "00000000-0000-0000-0000-000000000000" } } "StaticResources/SharedResources/BaseThemes/CY24SU10.json" = { source = "${local.path}/StaticResources/SharedResources/BaseThemes/CY24SU10.json" } "StaticResources/RegisteredResources/fabric_48_color10148978481469717.png" = { source = "${local.path}/StaticResources/RegisteredResources/fabric_48_color10148978481469717.png" } } } ``` -------------------------------- ### Generate Documentation Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Execute this command to automatically generate user documentation markdown files from schema information and templates. ```shell task docs ``` -------------------------------- ### fabric_folder Data Source Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/folder.md Example usage of the fabric_folder data source to retrieve folder details by ID and workspace ID. ```APIDOC ## fabric_folder (Data Source) ### Description The Folder data-source allows you to retrieve details about a Fabric Folder. -> This data-source supports Service Principal authentication. ~> This data-source is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration. ### Example Usage ```terraform data "fabric_folder" "example_by_id" { id = "11111111-1111-1111-1111-111111111111" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` ### Schema #### Required - `id` (String) The Folder ID. - `workspace_id` (String) The workspace ID. #### Optional - `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) ### Read-Only - `display_name` (String) The Folder display name The name must meet Folder name requirements: . - `parent_folder_id` (String) The parent folder ID. If not specified or null, the folder is created with the workspace as its parent folder. ### Nested Schema for `timeouts` Optional: - `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). ``` -------------------------------- ### fabric_connection_role_assignment Resource Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/connection_role_assignment.md This example demonstrates how to create a connection role assignment for a user. Ensure you have the correct Connection ID and Principal ID. ```terraform resource "fabric_connection_role_assignment" "example" { connection_id = "00000000-0000-0000-0000-000000000000" principal = { id = "11111111-1111-1111-1111-111111111111" type = "User" } role = "Owner" } ``` -------------------------------- ### Create a Fabric Shortcut to Google Cloud Storage Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/shortcut.md Set up a shortcut to a Google Cloud Storage bucket. A valid `connection_id` is necessary for access. ```terraform resource "fabric_shortcut" "google_cloud_storage" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" name = "MyShortcutName" path = "MyShortcutPath" target = { google_cloud_storage = { location = "https://[bucket-name].storage.googleapis.com" subpath = "/folder" connection_id = "22222222-2222-2222-2222-222222222222" } } } ``` -------------------------------- ### Configure Explicit Installation Method Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/index.md For developers, this configuration allows Terraform to use local provider binaries. Ensure the `path` points to your provider installation directory. ```hcl # Explicit Installation Method Configuration # docs: https://developer.hashicorp.com/terraform/cli/config/config-file#explicit-installation-method-configuration provider_installation { filesystem_mirror { path = "/usr/share/terraform/providers" include = ["registry.terraform.io/microsoft/fabric"] } } ``` -------------------------------- ### Run All Unit Tests Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/DEVELOPER.md Execute this command to run all unit tests. Unit tests operate against a fake server and do not create actual resources. ```shell task testunit ``` -------------------------------- ### Example Usage of fabric_workspace_managed_private_endpoint Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/workspace_managed_private_endpoint.md This example demonstrates how to configure a workspace managed private endpoint in Terraform. Ensure you replace placeholder values with your actual resource IDs and names. ```terraform resource "fabric_workspace_managed_private_endpoint" "example" { workspace_id = "00000000-0000-0000-0000-000000000000" name = "example" target_private_link_resource_id = "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.Storage/storageAccounts/RESOURCE_NAME" target_subresource_type = "blob" request_message = "Request message to approve private endpoint" } ``` -------------------------------- ### fabric_digital_twin_builder Resource - Example Usage Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/digital_twin_builder.md Example of creating a Digital Twin Builder item without a definition. Ensure to use a User context authentication and enable preview mode. ```terraform resource "fabric_digital_twin_builder" "example_definition" { display_name = "example" description = "example without definition" workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### Create fabric_activator with definition bootstrapping Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/activator.md This example demonstrates creating an Activator with definition bootstrapping only, disabling definition updates. The `definition` block specifies the source file for the definition. ```terraform resource "fabric_activator" "example_definition_bootstrap" { display_name = "example" description = "example with definition bootstrapping" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false format = "Default" definition = { "ReflexEntities.json" = { source = "${local.path}/ReflexEntities.json" } } } ``` -------------------------------- ### fabric_datamarts Data Source Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/datamarts.md This example shows how to retrieve a list of Fabric Datamarts within a specified workspace. Ensure you are using user context authentication and have enabled preview mode in the provider configuration. ```terraform data "fabric_datamarts" "example" { workspace_id = "00000000-0000-0000-0000-000000000000" } ``` -------------------------------- ### fabric_onelake_data_access_security Data Source Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/data-sources/onelake_data_access_security.md This example shows how to use the fabric_onelake_data_access_security data source to retrieve details about a specific OneLake data access security configuration within a Fabric workspace. Ensure preview mode is enabled in the provider configuration. ```terraform data "fabric_onelake_data_access_security" "example" { workspace_id = "00000000-0000-0000-0000-000000000000" item_id = "11111111-1111-1111-1111-111111111111" role_name = "example" } ``` -------------------------------- ### Create a new SQL database with custom settings Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/sql_database.md This snippet demonstrates creating a new SQL database with custom settings such as backup retention days and collation. The 'creation_mode' must be set to 'New'. ```terraform resource "fabric_sql_database" "example_new" { display_name = "example_new" workspace_id = "00000000-0000-0000-0000-000000000000" configuration = { creation_mode = "New" backup_retention_days = 10 collation = "SQL_Latin1_General_CP1_CI_AS" } } ``` -------------------------------- ### Operations Agent with Definition Bootstrapping Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/operations_agent.md This example demonstrates bootstrapping an Operations Agent with a definition file. Set `definition_update_enabled` to `false` to prevent automatic updates based on source changes. ```terraform resource "fabric_operations_agent" "example_definition_bootstrap" { display_name = "example" description = "example with definition bootstrapping" workspace_id = "00000000-0000-0000-0000-000000000000" definition_update_enabled = false format = "Default" definition = { "Configurations.json" = { source = "${path.module}/Configurations.json" } } } ``` -------------------------------- ### VirtualNetworkGateway Connection Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/connection.md Example of creating a VirtualNetworkGateway connection with FTP details and basic credentials. ```APIDOC ## fabric_connection VirtualNetworkGateway Connection ### Description Manages a VirtualNetworkGateway type Fabric Connection. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **gateway_id** (string) - Required - The ID of the gateway. - **display_name** (string) - Required - The display name for the connection. - **connectivity_type** (string) - Required - The type of connectivity. - **privacy_level** (string) - Required - The privacy level of the connection. - **connection_details** (object) - Required - Details about the connection. - **type** (string) - Required - The type of connection. - **creation_method** (string) - Required - The creation method for the connection. - **parameters** (list of objects) - Optional - Parameters for the connection. - **name** (string) - Required - The name of the parameter. - **value** (string) - Required - The value of the parameter. - **credential_details** (object) - Required - Details about the credentials. - **connection_encryption** (string) - Required - The encryption method for the connection. - **credential_type** (string) - Required - The type of credential. - **single_sign_on_type** (string) - Required - The single sign-on type. - **skip_test_connection** (bool) - Optional - Whether to skip testing the connection. - **basic_credentials** (object) - Required if credential_type is Basic - Basic authentication credentials. - **username** (string) - Required - The username for basic authentication. - **password_wo** (string) - Required - The password for basic authentication. - **password_wo_version** (int) - Required - The version of the password. ### Request Example ```terraform resource "fabric_connection" "example_virtual_network_gateway" { gateway_id = "00000000-0000-0000-0000-000000000000" display_name = "example" connectivity_type = "VirtualNetworkGateway" privacy_level = "Organizational" connection_details = { type = "FTP" creation_method = "FTP.Contents" parameters = [ { name = "server" value = "ftp.example.com" } ] } credential_details = { connection_encryption = "NotEncrypted" credential_type = "Basic" single_sign_on_type = "None" skip_test_connection = false basic_credentials = { username = "user" password_wo = "...secret_password..." password_wo_version = 1 } } } ``` ### Response #### Success Response (200) Schema not provided in source. #### Response Example None provided in source. ``` -------------------------------- ### Import Dataflow Example Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/dataflow.md Use the `terraform import` command with the resource address and the Dataflow's WorkspaceID and DataflowID. Ensure you have the correct IDs before running the command. ```shell # terraform import fabric_dataflow.example "/" terraform import fabric_dataflow.example "00000000-0000-0000-0000-000000000000/11111111-1111-1111-1111-111111111111" ``` -------------------------------- ### Data Agent without definition Source: https://github.com/microsoft/terraform-provider-fabric/blob/main/docs/resources/data_agent.md Use this example to create a basic Data Agent without any specific definition bootstrapping. It requires a display name and workspace ID. ```terraform resource "fabric_data_agent" "example" { display_name = "example" workspace_id = "00000000-0000-0000-0000-000000000000" } ```