Azure / Azure/azure-cli

az keyvault key create shows extremely confusing error message

Open
#16,507 1 comment 0 reactions 1 assignee Claimed by @houk-ms View on GitHub
act-identity-squad KeyVault
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

**Command Name**
`az keyvault key create`

**Errors:**
```
InvalidArgumentValueError: az keyvault key create: 'EDWARDS25519' is not a valid value for '--curve'.
```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- _Put any pre-requisite steps here..._
- `az keyvault key create --hsm-name mhsmdemo2 --kty EC-HSM --curve EDWARDS25519 --name ed25519key`

## Expected Behavior

The first error message in the line InvalidArgumentValueError is correct.
The "Try this: 'az keyvault key create --kty EC --name mykey **--size {size}** --vault-name myvault'" text is completely wrong. When creating a EC key, the --size argument is invalid. It must be a --curve argument. --size argument is only valid for RSA, RSA-HSM and oct-HSM keys.

The Try this message in this case should be:
Try this: 'az keyvault key create --kty EC --name mykey **--curve {curve_name}** --vault-name myvault

## Environment Summary
```
Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.15.1 *

```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.