Skip to content

[KeyVault] az keyvault secret set --expires flag silently accepts invalid date format #33233

@notyashhh

Description

@notyashhh

Describe the bug

az keyvault secret set --expires "2025-13-45" does not validate the date and silently passes the invalid value to the API, resulting in a confusing 400 Bad Request from the service.

Steps to reproduce

az keyvault secret set --vault-name myvault --name mysecret --value test --expires "2025-13-45"

Current behavior

(BadParameter) Property expires in value "2025-13-45" is not a valid UTC datetime.

The error comes from the service, not from the CLI. The CLI should catch this before sending the request.

Expected behavior

The CLI should validate --expires locally and return a clear error:

ERROR: Invalid date format for --expires: "2025-13-45". Expected format: YYYY-MM-DD or ISO 8601 datetime.

Environment

  • az cli version: 2.85.0
  • OS: macOS 14.5
  • Shell: zsh

This is a test issue for demonstrating the Sentinel triage agent.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamError MessagesKeyVaultaz keyvaultact-identity-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions