4

I have a requirement where I need to store my secret name as fname_lname. But when I tried with underscore I got following error. For time being to bypass the error I wrote a utility to convert from underscore to hyphen and vice versa.

Is there any reason why there is no support for basic special character like underscore?

az keyvault secret set --vault-name 'my-kv' -n 'fname_lname' -v 'myvalue' parameter 'secret_name' must conform to the following pattern: '^[0-9a-zA-Z-]+$'.

lambodar
  • 3,495
  • 5
  • 34
  • 58
  • As you no doubt know the regular expression '^[0-9a-zA-Z-]+$' indicates that only Secret names can only contain alphanumeric characters and dashes. Why it doesn't support basic special character is an overall system design questions, only the designers of the system can assist with that question. – Hannel Dec 11 '18 at 17:35

1 Answers1

7

It seems that we could not find any technical reason as to why the basic special characters are not supported. Also in the REST API Set Secret, it just mentioned the name should be like Regex pattern: ^[0-9a-zA-Z-]+$ without the reason, it should by designed.

There are also some user voices in the azure feedback: Secret Names do not support special characters, if you want to improve azure keyvault, you could vote it.

Paul Hatcher
  • 7,342
  • 1
  • 54
  • 51
Joy Wang
  • 39,905
  • 3
  • 30
  • 54
  • I came across with the one you posted but I'm looking to heard from azure team. I appreciated your proactive reply though. – lambodar Dec 12 '18 at 08:09
  • @lambodar well, hope azure team will reply to the feedback. – Joy Wang Dec 12 '18 at 08:16
  • There is a new [address](https://feedback.azure.com/d365community/idea/8b46339b-f624-ec11-b6e6-000d3a4f0da0) of the feedback page. – Alex Boo Sep 19 '22 at 17:15