Skip to content

Environment domain - Provider produced inconsistent result after apply #1031

@MarvinBangert

Description

@MarvinBangert

Describe the bug

While running the powerplatform_environment resource, I received this message:

powerplatform_environment.environment["CollabDays"]: Still creating... [30s elapsed]
│ Error: Provider produced inconsistent result after apply

│ When applying changes to powerplatform_environment.environment["CollabDays"], provider
│ "provider["registry.opentofu.org/microsoft/power-platform"]" produced an unexpected new value: .dataverse.domain: was
│ cty.StringVal("CollabDays-Bremen-2026"), but now cty.StringVal("collabdays-bremen-2026").

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Sample Terraform Code

locals {
    # Get Config files
    config_files = fileset("${path.module}/config", "*.yaml")
    
    configs = {
        for file in local.config_files :
        trimsuffix(file, ".yaml") => yamldecode(file("${path.module}/config/${file}"))
    }
}

resource "powerplatform_environment" "environment" {
    for_each = local.configs

    display_name     = each.value.environment.name
    location         = each.value.environment.location
    environment_type = each.value.environment.type
    cadence          = each.value.environment.cadence
    dataverse = {
        language_code     = each.value.environment.dataverse_language_code
        currency_code     = each.value.environment.dataverse_currency_code
        security_group_id = azuread_group.dataverse_group[each.key].object_id
        domain            = replace(each.value.environment.name, " ", "-")
  }
}
environment:
  name: "CollabDays Bremen 2026"
  location: "europe" # "unitedstates", "europe", "australia", etc.
  type: "Sandbox" # "Production", "Sandbox", "Trial"
  cadence: "Moderate" # "Moderate", "Frequent"
  dataverse_language_code: 1033 # 1033 = English, 1036 = French, 1031 = German, etc.
  dataverse_currency_code: "EUR" # "EUR", "USD", etc.

dlp:
  policies:
    business_data_groups:
      - "onedrive"
      - "approvals"
      - "sharepointonline"

REMINDER: REMOVE SENSITIVE DATA SUCH AS SECRETS, USER NAMES, EMAILS, TENANT INFORMATION, ETC.

Expected behavior

It seems to work, it just produced this error message and the apply stopped.

System Information

  • Provider Version: 4.0.0
  • OS & Version: Windows

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions