Bug regarding types in az storage entity?

Johannes Weiman 1 Reputation point
2021-12-17T15:27:41.987+00:00

We have problems using Azure CLI to update a storage table (non-Cosmos). A string like "2021.4" will be converted to a Double and there seems to be no way to avoid that.
I have looked here: https://stackoverflow.com/questions/46834171/how-do-i-specify-the-field-types-when-using-the-azure-cli-entity-insert-command
but passing odata.type=Edm.String causes the call to fail in this case.

See the following commands:

az storage entity merge (account, table etc) --table-name Products --entity PartitionKey=”fisken” RowKey=”” DisplayVersion=”Fisk”

-> Success, data type is String

az storage entity merge (…) --entity PartitionKey=”fisken” RowKey=”” DisplayVersion=”2021”

-> Success, data type is Int64

az storage entity merge (…) --entity PartitionKey=”fisken” RowKey=”” DisplayVersion=”2021” DisplayVersion@odata.type=Edm.String

-> Success, data type is String

az storage entity merge (…) --entity PartitionKey=”fisken” RowKey=”” DisplayVersion=”2021.4”

-> Success, data type is Double

az storage entity merge (…) --entity PartitionKey=”fisken” RowKey=”” DisplayVersion=”2021.4” DisplayVersion@odata.type=Edm.String

-> ERROR!

Client-Request-ID=(...) Retry policy did not allow for a retry: Server-Timestamp=Fri, 17 Dec 2021 13:16:09 GMT, Server-Request-ID=(...), HTTP status code=400, Exception=Bad Request{"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"An error occurred while processing this request.\nRequestId:(...)\nTime:2021-12-17T13:16:09.9515564Z"}}}.
Bad Request
{"odata.error":{"code":"InvalidInput","message":{"lang":"en-US","value":"An error occurred while processing this request.\nRequestId:(...)\nTime:2021-12-17T13:16:09.9515564Z"}}}

Surely this must be a bug?

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
166 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.