Skip to content

Commit fc2a0f5

Browse files
authored
Fixed azure_key_vault_secret crashes when keyvault name is camel-case Closes #637 (#638)
1 parent 30b991e commit fc2a0f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

azure/table_azure_key_vault_secret.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,10 @@ func getTurbotData(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDa
272272

273273
var vaultID, location string
274274
for _, i := range op.Values() {
275-
if *i.Name == vaultName {
275+
// The secret ID contains the Vault Name in lowercase, and here we are extracting the vault name by splitting the secret ID.
276+
// However, if the vault name is in camel case, the current condition will not match, leading to a runtime error: index out of range [4].
277+
// To address this issue, we should include a ToLower() check to ensure consistency and prevent potential errors.
278+
if strings.ToLower(*i.Name) == vaultName {
276279
vaultID = *i.ID
277280
location = *i.Location
278281
}

0 commit comments

Comments
 (0)