Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add VaultAliases.json entry w/o corresponding entry in Vaults.json #48

Open
aaronpburke opened this issue Jun 1, 2022 · 1 comment

Comments

@aaronpburke
Copy link

If I have a default Vaults.json file (empty), the documentation states that I should be able to add a simple Vault entry to the dropdown by adding the following to VaultAliases.json (using default AAD auth). I assume this behavior is likely true for any entry in VaultAliases.json without a corresponding entry in Vaults.json:

[
  {
    "Alias": "MyVault",
    "VaultNames": [ "MyVault" ]
  }
]

But when I do, it throws the following exception:

System.Collections.Generic.KeyNotFoundException: MachineTranslationInt is not found in C:\Users\aaburke\OneDrive - Microsoft\AKVExplorer\Vaults.json
   at Microsoft.Vault.Library.Vault.<>c__DisplayClass19_0.<CreateKeyVaultClientEx>b__0(String authority, String resource, String scope)
   at Microsoft.Azure.KeyVault.KeyVaultCredential.<PreAuthenticate>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.KeyVault.KeyVaultCredential.<ProcessHttpRequestAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.KeyVault.KeyVaultClient.<GetSecretsWithHttpMessagesAsync>d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.<GetSecretsAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Vault.Library.Vault.<ListSecretsAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Vault.Explorer.MainForm.<>c__DisplayClass32_1.<<uxMenuItemRefresh_Click>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Vault.Explorer.UxOperation.<>c__DisplayClass12_1.<<Invoke>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Vault.Explorer.UxOperation.<Invoke>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Vault.Explorer.MainForm.<uxMenuItemRefresh_Click>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Adding the following to Vaults.json fixes the issue:

[
  {
    "Alias": "MyVault",
    "VaultNames": [ "MyVault" ]
  }
]

This is in contrast to the documentation, which states:

Here is an example of a single vault not defined in Vaults.json

  {
    "Alias": "DEV",
    "VaultNames": [ "TestKeyVault" ]
  }
@VictorioBerra
Copy link

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants