Skip to content

az keyvault key decrypt/encrypt -o tsv output gives bytes string literals since 2.31.0 #22457

@avishnyakov

Description

@avishnyakov

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

2.31.0+

az keyvault key decrypt/encrypt ... \
  --query 'result' \
  --output tsv 

# note, this is should be 1a2864.... but it is wrapped into b'' literal
b'1a2864....' 

With 2.30.0

az keyvault key decrypt/encrypt ... \
  --query 'result' \
  --output tsv 

# note, value is plan without being wrapped into b''
1a2864....

More testing:
--output json -> "1a2864...." (note, value in double quotes)
--output tsv -> b'1a2864....' (b-prefix and single quotes)
then --output table

Result
--------------------------------
1a2864....

Describe the bug
az keyvault key decrypt/encrypt operations with -tsv appears to wrap resulting value into b'{actual_value_here}'. Version 2.30.0 does not have this behavior, returns plain value. Version 2.31.0 and upper wraps plain text value into b'{actual_value_here}'.

To Reproduce
Version 2.31.0 and upper -> gives b'{actual_value_here}' and 2.30 does not.

az keyvault key decrypt/encrypt ... \
  --query 'result' \
  --output tsv 

Expected behavior
Version 2.31.0 and upper -> gives plain text output of the value (NO b'' wrap)

az keyvault key decrypt/encrypt ... \
  --query 'result' \
  --output tsv 

Environment summary
Tested on windows, macos and docker images

Additional context

  • N/A

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botKeyVaultaz keyvaultcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions