fix(autopilot): preserve hybrid_azure_ad_join_skip_connectivity_check for azure ad joined profiles #888
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "Provider produced inconsistent result after apply" error for
microsoft365_graph_beta_device_management_windows_autopilot_deployment_profileresource when using Azure AD joined profiles. Thehybrid_azure_ad_join_skip_connectivity_checkfield was incorrectly becomingnullafter apply instead of maintaining its configuredfalsevalue.Issue Reference
Fixes issue where Terraform reported:
.hybrid_azure_ad_join_skip_connectivity_check: was cty.False, but now nullMotivation and Context
device_join_type = "microsoft_entra_joined"andhybrid_azure_ad_join_skip_connectivity_check = false, Terraform would report an inconsistency error after applyhybridAzureADJoinSkipConnectivityCheckproperty only exists onactiveDirectoryWindowsAutopilotDeploymentProfile(Hybrid AD joined). It does NOT exist onazureADWindowsAutopilotDeploymentProfile(Azure AD joined). The state mapping was not preserving the configured value when the API didn't return the field.Dependencies
None
Type of Change
Please mark the relevant option with an
x:Testing
Quality Checklist
Screenshots/Recordings (if appropriate)
[Add screenshots or recordings that demonstrate the changes]
Additional Notes
Changes Made
Updated
state.go: ModifiedMapRemoteResourceStateToTerraform()to properly handle thehybrid_azure_ad_join_skip_connectivity_checkfield:GetHybridAzureADJoinSkipConnectivityCheck()falseif null/unknown)Corrected Test Mocks: Updated test mock JSON files to match actual Microsoft Graph API behavior:
hybridAzureADJoinSkipConnectivityCheckfrompost_windows_autopilot_deployment_profile_success.json(Azure AD joined)hybridAzureADJoinSkipConnectivityCheckfrompost_windows_autopilot_deployment_profile_04_hololens.json(Azure AD joined)hybridAzureADJoinSkipConnectivityCheckinpost_windows_autopilot_deployment_profile_02_hybrid.json(Hybrid AD joined)API Documentation Reference
hybridAzureADJoinSkipConnectivityCheckpropertyhybridAzureADJoinSkipConnectivityCheckproperty