SecretNotFound 🔷 Azure

Key Vault: (SecretNotFound) A secret with (name/id) x was not found in this key vault

The secret name (or version) doesn’t exist in that vault — typo, wrong vault, or the secret is deleted (soft-deleted).

Seen on: Azure

Meaning

Secret names are case-insensitive but must match exactly otherwise. Deleted secrets stay in a soft-deleted state and can block recreating the same name until recovered or purged.

Common causes

  • Wrong secret name or vault
  • Secret deleted (soft-delete)
  • Specific version no longer exists
  • App Service Key Vault reference using wrong URI

⚡ Quick fix

  1. List secrets: az keyvault secret list
  2. Recover soft-deleted: az keyvault secret recover
  3. Fix the reference URI

Detailed fix by platform

Azure CLI

  1. bash
    az keyvault secret list --vault-name kv-app --query "[].name"
    az keyvault secret list-deleted --vault-name kv-app
    az keyvault secret recover --vault-name kv-app -n DbPassword

How to diagnose

  1. Name — Exact name/version
  2. Vault — Right one?
  3. Deleted — In list-deleted?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.