I’m trying to migrate from a manual unseal process using the shamir keys to an Azure based autounseal. However the migration instructions here: Seal/Unseal | Vault | HashiCorp Developer have proven to be impossible to follow.
I’ve got an Azure key store set up and have added the
seal “azurekeyvault” {
}
config to the vault.hcl file with the credentials. The instructions suggest that to migrate the seal all I need to do is to start the vault and then unlock it using the command line tool with -migrate flag . The problem is that the vault won’t start, I get this error in the log:
RESPONSE 404: 404 Not Found
ERROR CODE: KeyNotFound
{
“error”: {
“code”: “KeyNotFound”,
“message”: “A key with (name/id) autounsealkey was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see Azure Key Vault recovery overview | Microsoft Learn”
}
}
I would consider this error to be expected prior to the migration process being completed, the problem is that the vault process exits straight after this error with no further explanation (and if I take out the azure config it works again). So when I use the command line tool with the -migrate flag, I just get a connection refused error because the vault isn’t running.
I’ve checked and re-checked the documentation and I can’t see what I might have missed so have reached an impasse. To migrate to azure autounseal I need to start the vault with azure configured, but the vault won’t start if the azure config is present. My expectation was that with an un-migrated autounseal configuration, the vault would start but remain sealed until I performed the migration. Is there any way to persuade the vault process to not exit if unseal fails?
I’m using v1.17.2. Thanks in anticipation!