question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az storage entity does not set Boolean type data properly

See original GitHub issue

Describe the bug

The “storage entity insert” command does not correctly set the boolean type in v2.36.0 when the type is specified. This was working correctly in v2.35.

Command Name az storage entity insert ... --entity Active=true Active@odata.type="Edm.Boolean"

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Create a storage table
  • Use az storage entity insert command to insert data
  • Specify one of the value as boolean: --entity Active=true Active@odata.type="Edm.Boolean"

Expected Behavior

The value should be stored in the table as Edm.Boolean, and a query should return the data as a boolean value.

This was working in previous versions. Compare with how it used to work in 2.35:

PS> az storage entity insert --table-name $tableName --if-exists merge --entity PartitionKey="$partitionKey" RowKey="$rowKey" Active=true Active@odata.type="Edm.Boolean"
{
  "date": "2022-04-27T13:37:22+00:00",
  "etag": "W/\"datetime'2022-04-27T13%3A37%3A22.8457701Z'\"",
  "version": "2019-02-02"
}
PS> az storage entity query --table-name $tableName --filter "PartitionKey eq '$partitionKey' and RowKey eq '$rowKey'" --select Active
{
  "items": [
    {
      "Active": true,
      "Timestamp": null,
      "etag": "W/\"datetime'2022-04-27T13%3A37%3A22.8457701Z'\""
    }
  ],
  "nextMarker": {}
}

Behavior in 2.36:

PS> az storage entity insert --table-name $tableName --if-exists merge --entity PartitionKey="$partitionKey" RowKey="$rowKey" Active=true Active@odata.type="Edm.Boolean"
{
  "date": "2022-04-27T13:43:56+00:00",
  "etag": "W/\"datetime'2022-04-27T13%3A43%3A56.9536465Z'\"",
  "version": "2019-02-02"
}
PS> az storage entity query --table-name $tableName --filter "PartitionKey eq '$partitionKey' and RowKey eq '$rowKey'" --select Active
{
  "items": [
    {
      "Active": "true",
      "Timestamp": null,
      "etag": "W/\"datetime'2022-04-27T13%3A43%3A56.9536465Z'\""
    }
  ],
  "nextMarker": {}
}

Viewed in Azure Storage Explorer: 2.35 image

2.36 image

Environment Summary

Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.36.0

Extensions:
application-insights 0.1.16
azure-devops 0.25.0
datafactory 0.5.0

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
evelyn-yscommented, May 17, 2022

The fix will be released on 5/24

1reaction
jsteenbekkerscommented, Apr 27, 2022

This is a breaking change for me because I am relying on the query values to be returned with the expected type.

Looks like this change in behavior was introduced with changes related to https://github.com/Azure/azure-cli/issues/22018

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert Entity (REST API) - Azure Storage - Microsoft Learn
The Insert Entity operation inserts a new entity into a table. Request. The Insert Entity request may be constructed as follows. HTTPS is...
Read more >
Azure Table Storage - Why are my bool and string properties ...
I understand that my Point property will not be saved to Table Storage. But when I insert this entity, the Container property and...
Read more >
REST API for Oracle Internet of Things Cloud Service - Update a ...
"name":"A name for the attribute. Name can contain only A-Z, a-z, 0-9 or underscore (_) characters.", "type":"The data typeOne of [STRING, NUMBER, BOOLEAN, ......
Read more >
AWS::DMS::ReplicationInstance - AWS CloudFormation
You can't set the AvailabilityZone parameter if the Multi-AZ parameter is set to true . Required: No. Type: Boolean. Update requires: No interruption....
Read more >
NBT format - Minecraft Wiki - Fandom
The requested data tags in the target entity/block/storage must match exactly for the provided tags to pass, including the data type (e.g. 1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found