Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Remote State Behavior for defaultManagementGroup in "Microsoft.Management/managementGroups/settings@2023-04-01" #33001

Open
ms-henglu opened this issue Mar 5, 2025 · 0 comments

Comments

@ms-henglu
Copy link
Member

Description

Issue Summary

When using the Microsoft.Management/managementGroups/settings API (2023-04-01 version) to configure the defaultManagementGroup property, there is a discrepancy between what the API requires during resource creation and what it returns in the remote state.

Expected Behavior:

The API requires the full ID of the management group (e.g., /providers/Microsoft.Management/managementGroups/) to set the defaultManagementGroup property.
The API should return the same full ID in the remote state to maintain consistency.

Actual Behavior:

After applying the configuration, the API returns only the name of the management group (e.g., ), not the full ID. This causes tools like Terraform to detect changes during subsequent plan and apply actions, as the returned value doesn't match the expected input.

Steps to Reproduce

Use the following payload to configure the default management group settings:

{  
    "properties": {  
        "defaultManagementGroup": "/providers/Microsoft.Management/managementGroups/mg-sandbox",  
        "requireAuthorizationForGroupCreation": true  
    }  
}  
  1. The API accepts the request and successfully creates the resource.

  2. Fetch the remote state of the resource (e.g., via GET request or tools like Terraform). The defaultManagementGroup property in the response shows only the name of the management group (mg-sandbox), instead of the full ID.

  3. This discrepancy causes tools like Terraform to repeatedly detect changes, leading to unnecessary updates.

Expected Behavior

The API should return the full ID (e.g., /providers/Microsoft.Management/managementGroups/mg-sandbox) for the defaultManagementGroup property in the response, matching what it required during the creation process.

Actual Behavior

The API returns only the name (e.g., mg-sandbox) instead of the full ID in the remote state, leading to state mismatches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant