Open clarkperkins opened 1 year ago
Hi, @clarkperkins -- did those other attributes actually change, or just the displayName
after you apply?
I didn't actually run the apply because I don't want to drop and re-create the service principals (as that will remove the PATs associate with the SPs). I will try running the apply in a test environment though to see what happens.
So after running the apply, none of the other attributes actually changed. The id
remained the same after dropping / recreating the SP. ~But it did nullify/expire the PATs for the SP as I suspected it would.~ EDIT: see comment below, this was incorrect.
But it did nullify/expire the PATs for the SP as I suspected it would.
Ah, that is unexpected.
Using the PATCH
API just updates displayName
, too.
this is because we force recreating the sp if the display name is changed - https://github.com/databricks/terraform-provider-databricks/blob/master/scim/resource_service_principal.go#L95
If updating displayName
is allowed in all cases, then we need to remove force_new
here
I don't have a way to test this out on AWS or GCP databricks - but azure databricks definitely allows updating displayName
on service principals.
As an update - I was doing some more testing around this issue today and realized the PATs DO actually still work after deleting and recreating an SP. I must have messed up something in my initial tests a couple of weeks ago. Sorry for the confusion there!
I am using azure databricks. When I attempt to modify the
display_name
of an existingdatabricks_service_principal
resource on either the account level or the workspace level, the databricks provider wants to delete and recreate the service principal. This should not be required, as azure databricks allows modifying display names of service accounts.Configuration
Expected Behavior
Plan should report an update-in-place change instead of replacing the service account.
Actual Behavior
Plan reports a replacement of the service account:
Steps to Reproduce
terraform plan
andterraform apply
with a databricks service principal as abovedisplay_name
of the SP resourceterraform plan
Terraform and provider versions
Debug Output
Important Factoids