Skip to content

Bug: azuread_app_role_assignment - Provider produced inconsistent result after apply #1834

@gokulhari19

Description

@gokulhari19

Issue Description
When running terraform apply, we are consistently receiving a Provider produced inconsistent result after apply error specifically for the azuread_app_role_assignment resource.

The error message suggests that after applying the changes, the provider unexpectedly reports that the Root object was present, but now absent, indicating a bug in how the provider is reading the state of the resource post-creation.

Provider Version
AzureAD Provider Version: 3.4.0

Affected Resource(s)
azuread_app_role_assignment

Steps to Reproduce
Due to the confidential nature of our configuration, I cannot share the complete code. However, the issue occurs in the following context:

We define azuread_app_role_assignment resources within a reusable Terraform module.

We use a for_each loop to create multiple role assignments based on a map of objects.

Running terraform apply attempts to create these assignments.

The operation fails with the error below, even though it appears the changes might be partially or fully applied in Azure AD.

Error Output
Error: Provider produced inconsistent result after apply

When applying changes to
module.solace-cloud-service.module.entraid_config.azuread_app_role_assignment.broker_roles_assignments["xxx-xxx-xxx-xxxx-xxxx.broker.read-only"],
provider "module.solace-cloud-service.module.entraid_config.provider["registry.terraform.io/hashicorp/azuread"]"
produced an unexpected new value: Root object was present, but now absent.

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

(Note: This error repeats for multiple instances of the resource being created.)

Expected Behavior
terraform apply should complete successfully, creating the azuread_app_role_assignment resources and correctly persisting the final state without error.

Actual Behavior
The apply operation fails with the "Provider produced inconsistent result after apply" error, preventing the Terraform run from completing successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions