You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Could not update user with ID: "XXXXXXX"
with module.user["XXXXXXX"].azuread_user.user,
on ../modules/user/main.tf line 1, in resource "azuread_user" "user":
1: resource "azuread_user" "user" {
UsersClient.BaseClient.Patch(): unexpected status 400 with OData error:
Request_BadRequest: Unable to update the specified properties for objects
that have originated within an external service.
Expected Behavior
Existing users in AD that have attributes with 'null' on the Graph API side should have those attributes ignored when we want to update other, non-null attributes.
Actual Behavior
We observe that null valued attributes are unmarshalled to False values, which results in some API errors on resubmission, with the actual amended attributes.
Steps to Reproduce
Find a user that originates from an Exchange Directory, not created within Azure AD directly.
Update an attribute such as email address or job title in the Terraform config
terraform apply
Observe an update error
Important Factoids
These are possibly legacy users, though we aren't able to discern any material differences between them and newer users. The main attribute we are having issue with is show_in_address_list as this is managed by Exchange, and isn't available for update through Graph.
We see the affected users show_in_address_list attribute that is null on the API side, have that value set to False in the PATCH request to update the other attribute(s)
The text was updated successfully, but these errors were encountered:
Hi @jnq-moj, thanks for reporting this. As Terraform is intended to be declarative, we can't work around this for all attributes indiscriminately, however we should be able to manage this on a per-attribute basis.
I'll look at fixing this for the show_in_address_list property. Please advise if there are any other attributes protected by the API in the same way and I'll look at those too. Thanks!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.1.9 on darwin_amd64
hashicorp/azuread => 2.21.0
Terraform Configuration Files
Debug Output
Expected Behavior
Existing users in AD that have attributes with 'null' on the Graph API side should have those attributes ignored when we want to update other, non-null attributes.
Actual Behavior
We observe that null valued attributes are unmarshalled to False values, which results in some API errors on resubmission, with the actual amended attributes.
Steps to Reproduce
terraform apply
Important Factoids
These are possibly legacy users, though we aren't able to discern any material differences between them and newer users. The main attribute we are having issue with is
show_in_address_list
as this is managed by Exchange, and isn't available for update through Graph.We see the affected users
show_in_address_list
attribute that is null on the API side, have that value set to False in the PATCH request to update the other attribute(s)The text was updated successfully, but these errors were encountered: