I would like to know if a value in a TXT record is already available in the DNS:
az network dns record-set txt show -g myresourcegroup -z 'mydomain' -n 'mytxtvalues'
This is the part of the json result where it's all about:
"txtRecords": [
{
"value": [
"abc"
]
},
{
"value": [
"def"
]
}
]
I tried many queries. These are 2 which I expected to work.
az network dns record-set txt show -g myresourcegroup -z 'mydomain.com' -n 'mytxtvalues' --query txtRecords[?value[?starts_with(@, 'abc')]]
az network dns record-set txt show -g myresourcegroup -z 'mydomain.com' -n 'mytxtvalues' --query txtRecords[*].value[?starts_with(@, 'abc')]]
The result is:
At line:1 char:123 + ... 'mytxtvalues' --query txtRecords[?value[?starts_with(@, 'abc') ... + ~ Unrecognized token in source text. At line:1 char:124 + ... 'mytxtvalues' --query txtRecords[?value[?starts_with(@, 'abc')] ... + ~ Missing argument in parameter list.
It looks like the @ used to filter the array is not recognized. But I don't know how to query otherwise.
What would be a correct query to know if value abc is already in the list?