diff --git a/internal/sops/azkv/keysource.go b/internal/sops/azkv/keysource.go index b0b0f496..855ba327 100644 --- a/internal/sops/azkv/keysource.go +++ b/internal/sops/azkv/keysource.go @@ -222,14 +222,13 @@ func getDefaultAzureCredential() (azcore.TokenCredential, error) { ) var errorMessages []string - var creds []azcore.TokenCredential options := &azidentity.DefaultAzureCredentialOptions{} envCred, err := azidentity.NewEnvironmentCredential(&azidentity.EnvironmentCredentialOptions{ ClientOptions: options.ClientOptions, DisableInstanceDiscovery: options.DisableInstanceDiscovery}, ) if err == nil { - creds = append(creds, envCred) + return envCred, nil } else { errorMessages = append(errorMessages, "EnvironmentCredential: "+err.Error()) }