Skip to content

Commit

Permalink
azurerm_cognitive_account_customer_managed_key - `identity_client_i…
Browse files Browse the repository at this point in the history
…d` is no longer passed to the api when it is empty (#24231)
  • Loading branch information
mbfrahry authored Dec 14, 2023
1 parent bfaecf0 commit 1a96051
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -100,10 +101,13 @@ func resourceCognitiveAccountCustomerManagedKeyCreateUpdate(d *pluginsdk.Resourc
return err
}
props.Properties.Encryption.KeyVaultProperties = &cognitiveservicesaccounts.KeyVaultProperties{
KeyName: utils.String(keyId.Name),
KeyVersion: utils.String(keyId.Version),
KeyVaultUri: utils.String(keyId.KeyVaultBaseUrl),
IdentityClientId: utils.String(d.Get("identity_client_id").(string)),
KeyName: utils.String(keyId.Name),
KeyVersion: utils.String(keyId.Version),
KeyVaultUri: utils.String(keyId.KeyVaultBaseUrl),
}

if identityClientId := d.Get("identity_client_id").(string); identityClientId != "" {
props.Properties.Encryption.KeyVaultProperties.IdentityClientId = pointer.To(identityClientId)
}

// todo check if poll works in all the resources
Expand Down

0 comments on commit 1a96051

Please sign in to comment.