(azure-cli 2.0.72, did not try earlier versions) The command:
$ az network dns record-set txt add-record -g resourcegroup -z dns-zone-name.example.com -n example-record -v example-value
runs fine the first time, but subsequent invocations result in the following error:
Operation failed with status: 'Bad Request'. Details: The list of record sets of type 'TXT' may not contain multiple entries with the same 'value'.
In the spirit of https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md#standard-command-types I believe the subsequent operations should not result in an error, but should be a no-op instead (making this command idempotent).
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @karenhammons @sfiguemsft
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sfiguemsft
@jurjenoskam Hello. I will double check the logic for this command.
Any update on this? Thanks!
add to S168
@jurjenoskam, @tbennett0,
A record set cannot contain two identical records.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.
@jsntcy I am aware that there can't be two identical records in a record set, and I am aware the backend service returns an error if you try (although you could argue that the backend service PUT call should itself be idempotent, but that's another subject)
The point is that it would be very useful if Azure CLI commands were idempotent, as described in the command guidelines mentioned above.
If the Azure CLI command for adding a DNS record would be idempotent, it would only return an error when the end result is that the record is different from what is specified in the command. This allows my scripts to become much simpler: I only have to handle the situation when the record does not contain what I want it to contain. As it is now, I have to insert logic to check whether the data I'm trying to add is already there, and skip adding it if it is.
@jurjenoskam, thanks for sharing your thoughts. We'll discuss internally about this issue to come up with a general guideline for such scenarios as this should be a general issue for all services.
We will look into how other azure resources handle this scenario
Hi, any update to this?
I've had the same issue. Running the exact build script twice causes this error.
azure-cli version is 2.9.1
az network private-dns record-set a add-record --resource-group ria-poc-rg --zone-name privatelink.azurecr.io --record-set-name zahrpocriaacr --ipv4-address 10.214.11.36
Operation failed with status: 'Bad Request'. Details: The list of record sets of type 'A' may not contain multiple entries with the same 'ipv4Address'.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dnssuppgithub.
Most helpful comment
@jsntcy I am aware that there can't be two identical records in a record set, and I am aware the backend service returns an error if you try (although you could argue that the backend service PUT call should itself be idempotent, but that's another subject)
The point is that it would be very useful if Azure CLI commands were idempotent, as described in the command guidelines mentioned above.
If the Azure CLI command for adding a DNS record would be idempotent, it would only return an error when the end result is that the record is different from what is specified in the command. This allows my scripts to become much simpler: I only have to handle the situation when the record does not contain what I want it to contain. As it is now, I have to insert logic to check whether the data I'm trying to add is already there, and skip adding it if it is.