Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az storage entity does not set Boolean type data properly #22209

Closed
jsteenbekkers opened this issue Apr 27, 2022 · 5 comments · Fixed by #22483
Closed

az storage entity does not set Boolean type data properly #22209

jsteenbekkers opened this issue Apr 27, 2022 · 5 comments · Fixed by #22483
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage
Milestone

Comments

@jsteenbekkers
Copy link

jsteenbekkers commented Apr 27, 2022

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

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Apr 27, 2022
@ghost ghost added this to the Backlog milestone Apr 27, 2022
@ghost ghost assigned evelyn-ys Apr 27, 2022
@ghost ghost added Auto-Assign Auto assign by bot CXP Attention This issue is handled by CXP team. DevOps labels Apr 27, 2022
@jsteenbekkers
Copy link
Author

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 #22018

@yonzhan yonzhan removed DevOps CXP Attention This issue is handled by CXP team. labels Apr 27, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 27, 2022

storage

@jsteenbekkers
Copy link
Author

Can anyone comment on the availability of a workaround, or a timeline for a fix?

@steverash
Copy link

For a workaround - I ended up replacing with a call directly to the storage rest service.

@evelyn-ys
Copy link
Member

The fix will be released on 5/24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants