I want to integrate terraform with Microsoft, as I want to be able to create and manage multiple MS Fabric resources, such as workspaces, lakehouses etc. using Terraform and azure DevOps pipeline in microsoft fabric using terraform.
The best place to start would be with the Azure provider documentation. Terraform Registry
You may also find the getting started tutorial series helpful. Azure | Terraform | HashiCorp Developer
Azure is totally different to microsoft fabric, Microsoft Fabric is a Saas platform where we can create all data related things like data warehouse, data lakehouse, workspace etc.
i came to know we can automate Microsoft fabric resources using rest api’s, can i write those fabric api’s in terraform rest-api_provider ?
Fabric is a service offered upon Azure, is it not? I agree with @CraigW that the Azure provider should support this however I’ve searched through the docs and I don’t see anything pertaining to Fabric.
Most things for which a terraform provider exists will be based upon REST APIs. Can you give an example of one of these REST APIs?
There is an example here: Deploying Microsoft Fabric Capacity Using Terraform | by Aitor Murguzur | Medium of affecting Fabric using terraform. Following the code to azure-data-labs-modules/terraform/fabric/fabric-capacity/main.tf at main · Azure/azure-data-labs-modules · GitHub it uses azapi_resource
resource type which according to Terraform Registry is a resource that “can manage any Azure resource manager resource”
Hi, is there rest api provider in terraform, i’m trying to run the script, it is showing error
here is my code
terraform {
required_providers {
azurerm = {
source = “hashicorp/azurerm”
version = “=2.99.0”
}
azapi = {
source = “Azure/azapi”
}
restapi = {
source = “Mastercard/restapi”
version = “1.16.0” # Adjust the version as needed
}
}
}
provider “restapi” {
uri = “https://api.powerbi.com/v1.0/myorg/groups?workspaceV2=True”
write_returns_object = true
debug = true
headers = {
“Authorization” = “Bearer ${var.AUTH_TOKEN}”,
“Content-Type” = “application/json”
}
create_method = “POST”
update_method = “PATCH” # You can adjust this based on the use case.
destroy_method = “DELETE” # This is optional if you want to manage deletions.
}
resource “restapi_object” “powerbi_workspace” {
path = “/groups?workspaceV2=True”
data = jsonencode({
name = “powerbi Workspace”
description = “Description of the workspace”
})
Optional: Customize these based on your need.
create_path_suffix = “/groups?workspaceV2=True”
}
output “workspace_id” {
value = restapi_object.powerbi_workspace.id
}
output “workspace_name” {
value = restapi_object.powerbi_workspace.response[“name”]
}
rror: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider mastercard/restapi: no available releases match the
│ given constraints 1.16.0
╵
╷
│ Error: Failed to install provider
│
│ Error while installing azure/azapi v1.15.0: unsuccessful request to
│ https://github.com/Azure/terraform-provider-azapi/releases/download/v1.15.0/terraform-provider-azapi_1.15.0_windows_386.zip:
│ 403 Forbidden
╵
Please follow this issue for updates on Fabric support: Support for [Microsoft Fabric] · Issue #24522 · hashicorp/terraform-provider-azurerm · GitHub