Skip to content

[TEST] az keyvault secret show --vault-name returns misleading error when vault DNS is unreachable #33226

@notyashhh

Description

@notyashhh

Describe the bug

When running az keyvault secret show --vault-name myvault --name mysecret, if the Key Vault DNS is unreachable (e.g., due to private endpoint misconfiguration), the error message is misleading:

ERROR: (VaultNotFound) The vault "myvault" was not found. 

The actual issue is DNS resolution failure, not that the vault does not exist. This sends users down the wrong debugging path (checking vault names, subscription, etc.) when the real problem is network/DNS.

Steps to reproduce

  1. Create a Key Vault with private endpoint enabled
  2. Disable/misconfigure the private DNS zone
  3. Run: az keyvault secret show --vault-name myvault --name mysecret
  4. Observe misleading "VaultNotFound" error

Expected behavior

The error should indicate DNS resolution failure, e.g.:

ERROR: Could not resolve hostname "myvault.vault.azure.net". Check your network configuration and ensure private DNS is correctly configured if using private endpoints.

Environment

  • az cli version: 2.85.0
  • OS: Ubuntu 22.04
  • Shell: bash
  • Python: 3.11.2

This is a test issue for validating the Sentinel triage agent. It will be closed after testing.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamError MessagesKeyVaultaz keyvaultact-identity-squadquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions