Skip to content

Commit dc0e8fd

Browse files
authored
[Fix] Remove config drift if Azure SP is used in databricks_credential (#4294)
## Changes <!-- Summary of your changes that are easy to understand --> 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. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] relevant acceptance tests are passing - [ ] using Go SDK
1 parent cc49ffd commit dc0e8fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

catalog/resource_credential.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ func ResourceCredential() common.Resource {
9494
if err != nil {
9595
return err
9696
}
97+
// azure client secret is sensitive, so we need to preserve it
98+
var credOrig catalog.CredentialInfo
99+
common.DataToStructPointer(d, credentialSchema, &credOrig)
100+
if credOrig.AzureServicePrincipal != nil {
101+
if credOrig.AzureServicePrincipal.ClientSecret != "" {
102+
cred.AzureServicePrincipal.ClientSecret = credOrig.AzureServicePrincipal.ClientSecret
103+
}
104+
}
97105
d.Set("credential_id", cred.Id)
98106
return common.StructToData(cred, credentialSchema, d)
99107
},

0 commit comments

Comments
 (0)