Skip to content

Commit

Permalink
azurerm_key_vault - fix two kv in different sub issue (#19531)
Browse files Browse the repository at this point in the history
resolves #19509
  • Loading branch information
teowa authored Dec 5, 2022
1 parent 6739269 commit 9384b02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/services/keyvault/client/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ func (c *Client) BaseUriForKeyVault(ctx context.Context, keyVaultId parse.VaultI
lock[cacheKey].Lock()
defer lock[cacheKey].Unlock()

vaultsClient := c.VaultsClient
if keyVaultId.SubscriptionId != c.VaultsClient.SubscriptionID {
c.VaultsClient = c.KeyVaultClientForSubscription(keyVaultId.SubscriptionId)
vaultsClient = c.KeyVaultClientForSubscription(keyVaultId.SubscriptionId)
}

resp, err := c.VaultsClient.Get(ctx, keyVaultId.ResourceGroup, keyVaultId.Name)
resp, err := vaultsClient.Get(ctx, keyVaultId.ResourceGroup, keyVaultId.Name)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return nil, fmt.Errorf("%s was not found", keyVaultId)
Expand Down

0 comments on commit 9384b02

Please sign in to comment.