Skip to content

[BUG] fabric_workspace_git: Create operation failed for Service Principal #693

Description

🐛 What happened?

When trying to add Azure DevOps git integration using a service principal. An error message is thrown.

Could not create resource: The request could not be processed due to missing or invalid information / The operation is not supported for the principal type

Error Code: BadRequest / PrincipalTypeNotSupported

However, the repository is synced with the given workspace in the Fabric UI.

🔬 How to reproduce?

  1. Add the resource.
  2. Run terraform apply -auto-approve.
  3. Error occurs.
  4. Open the Fabric UI or call the rest api.
  5. View the git integration settings under workspace settings.

🏗️ Code Sample / Log

resource "fabric_workspace_git" "developer_workspace_git" {
  workspace_id            = "<workspace_id>"
  initialization_strategy = "PreferWorkspace"
  git_provider_details = {
    git_provider_type = "AzureDevOps"
    organization_name = "<organization_name>"
    project_name      = "<project_name>"
    repository_name   = "<repository_name>"
    branch_name       = "main"
    directory_name    = "/src"
  }
  git_credentials = {
    source        = "ConfiguredConnection"
    connection_id = "<connection_id>"
  }
}

📷 Screenshots

Terraform apply:

Image

After running terraform using the git connection api endpoint:

https://learn.microsoft.com/en-us/rest/api/fabric/core/git/get-connection?tabs=HTTP

gitConnectionState
------------------
ConnectedAndInitialized

📈 Expected behavior

The terraform should succeed because the Fabric UI shows the connected and initialized repository.

🌌 Environment (Provider Version)

1.6

🌌 Environment (Terraform Version)

1.13.3

🌌 Environment (OS)

macOS

📎 Additional context

Service Principal permissions:

  • Fabric connection (Azure DevOps - Source control (Preview))
  • Basic license in Azure DevOps
  • Contributor on the repository

🔰 Code of Conduct

  • I agree to follow this project's Code of Conduct.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions