Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AZ cli add secret to key vault that starts with a hyphen

I am trying to add a secret to my key vault using AZ-CLI:

az keyvault secret set --name my-secret --value "-secret.my"  --vault-name "foo"

As you can see my secret starts with a hyphen '-'. This produces the following error:

ArgumentParseError: argument --value: expected one argument
Try this: 'az keyvault secret set --name MySecret --value {value} --vault-name MyKeyVault'

Any ideas on how to circumvent this without changing the value of the secret?

like image 649
Jay05 Avatar asked Oct 27 '25 06:10

Jay05


1 Answers

Updating the answer :

Can you try with a "=" in front of the original value

This

az keyvault secret set --name my-secret --value="-secret.my"  --vault-name "foo"

instead of this

az keyvault secret set --name my-secret --value "-secret.my"  --vault-name "foo"

Here is the github reference

like image 59
Sajeetharan Avatar answered Oct 29 '25 05:10

Sajeetharan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!