Skip to content

Commit

Permalink
[Fix] Remove config drift if Azure SP is used in databricks_credential
Browse files Browse the repository at this point in the history
The same as in `databricks_storage_credential` - because Azure SP secret is sensitive
value, it isn't returned by API, and we need to copy it from the previous state.
  • Loading branch information
alexott committed Dec 4, 2024
1 parent f5fce0f commit 226066c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions catalog/resource_credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ func ResourceCredential() common.Resource {
if err != nil {
return err
}
// azure client secret is sensitive, so we need to preserve it
var credOrig catalog.CredentialInfo
common.DataToStructPointer(d, credentialSchema, &credOrig)
if credOrig.AzureServicePrincipal != nil {
if credOrig.AzureServicePrincipal.ClientSecret != "" {
cred.AzureServicePrincipal.ClientSecret = credOrig.AzureServicePrincipal.ClientSecret
}
}
d.Set("credential_id", cred.Id)
return common.StructToData(cred, credentialSchema, d)
},
Expand Down

0 comments on commit 226066c

Please sign in to comment.