我正在尝试创建一个 terraform,将 Fabric 容量分配给 Fabric 工作区 (Power BI.com)
我已成功从 terraform 创建容量和工作区,但由于某种原因,在尝试将容量链接到工作区时,我不断收到提供程序错误。
我使用 Az 登录进行登录,并使用有权访问容量和工作区的帐户进行身份验证。
主.tf
# Assign workspace to capacity
resource "microsoftfabric_workspace_capacity_assignment" "workspace_assignment" {
workspace_id = var.workspace_id
capacity_id = var.capacity_id
}
变量.tf
variable "workspace_id" {
description = "The ID of the Fabric workspace"
type = string
default = ""
}
variable "capacity_id" {
description = "The ID of the Fabric capacity"
type = string
default = ""
}
providers.tf
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
azapi = {
source = "Azure/azapi"
version = "1.15.0"
}
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
}
}
}
provider "azurerm" {
features {}
}
provider "azapi" {
# Configuration options
subscription_id = var.subscription_id
}
provider "fabric" {}
输出.tf
output "workspace_capacity_assignment_id" {
value = microsoftfabric_workspace_capacity_assignment.workspace_assignment.id
}
我不断收到的错误是
Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/microsoftfabric: provider registry registry.terraform.io does not have a provider named
│ registry.terraform.io/hashicorp/microsoftfabric
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending on
│ hashicorp/microsoftfabric, run the following command:
│ terraform providers
您似乎为 microsoftfabric_workspace_capacity_assignment 资源使用了错误的提供程序。
而不是使用 Microsoft Fabric Provider:
terraform {
required_providers {
# other providers here
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
}
}
}
# other providers here
provider "fabric" {}
尝试使用 microsoftfabric Provider 提供程序(由 Christopher Nagl 管理):
terraform {
required_providers {
# other providers here
microsoftfabric = {
source = "ChristopherNagl/microsoftfabric"
version = "0.5.1"
}
}
}
# other providers here
provider "microsoftfabric" {}