az storage entity insert forcing a string to int32 #30377
Labels
ARM
az resource/group/lock/tag/deployment/policy/managementapp/account management-group
Auto-Assign
Auto assign by bot
Auto-Resolve
Auto resolve by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Storage
az storage
Milestone
Describe the bug
String is being sent as a "property" to be inserted into a property, when viewing in the portal the string "0152" has been converted to type int32 and shows "052"
Related command
Errors
No errors, just incorrect behaviour
Issue script & Debug output
Script:
az account set --subscription XXX$ht2[$ .Name] = $.Value }
$path="./testFile.json"
$object = Get-Content $path | ConvertFrom-Json
$storageAccountName = "XXX"
$tableName = "XXX"
for ($i = 0; $i -lt $object.Count; $i++) {
$obj = $object[$i]
$partitionKey = $obj.PartitionKey
$rowKey = $obj.RowKey
$obj.PSObject.Properties.Remove('PartitionKey')
$obj.PSObject.Properties.Remove('RowKey')
Write-Host "PartitionKey: $partitionKey"
Write-Host "RowKey: $rowKey"
Write-Host "Modified Object:"
$obj | ConvertTo-Json -Depth 5
$ht2 = @{}
$obj.psobject.properties | Foreach {
Write-Host "ht2: $ht2"
Write-Host "Object: $obj"
}
Output:
PartitionKey: C2S_CROSS_GSAP_OU_MAP
RowKey: DEC-0154
Modified Object:
{
"CROSS_OUCode": "DEC",
"CROSS_TPPCode": "0154",
"CROSS_SSN": "",
"GSAP_OUCode": "DE01"
}
ht2: System.Collections.Hashtable
Object: @{CROSS_OUCode=DEC; CROSS_TPPCode=0154; CROSS_SSN=; GSAP_OUCode=DE01}
Value type: 0154
System.String
Property: CROSS_TPPCode=0154
{
"date": "2024-11-18T16:20:12+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A12.3183423Z'"",
"version": "2019-02-02"
}
Value type: DEC
System.String
Property: CROSS_OUCode=DEC
{
"date": "2024-11-18T16:20:13+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A13.7894865Z'"",
"version": "2019-02-02"
}
Value type:
System.String
Property: CROSS_SSN=
{
"date": "2024-11-18T16:20:14+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A15.148696Z'"",
"version": "2019-02-02"
}
Value type: DE01
System.String
Property: GSAP_OUCode=DE01
{
"date": "2024-11-18T16:20:16+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A17.0475922Z'"",
"version": "2019-02-02"
}
PartitionKey: C2S_CROSS_GSAP_OU_MAP
RowKey: DEF-0154
Modified Object:
{
"CROSS_OUCode": "DEF",
"CROSS_TPPCode": "0154",
"CROSS_SSN": "",
"GSAP_OUCode": "DE01"
}
ht2: System.Collections.Hashtable
Object: @{CROSS_OUCode=DEF; CROSS_TPPCode=0154; CROSS_SSN=; GSAP_OUCode=DE01}
Value type: 0154
System.String
Property: CROSS_TPPCode=0154
{
"date": "2024-11-18T16:20:18+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A18.8605368Z'"",
"version": "2019-02-02"
}
Value type: DEF
System.String
Property: CROSS_OUCode=DEF
{
"date": "2024-11-18T16:20:19+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A20.0078691Z'"",
"version": "2019-02-02"
}
Value type:
System.String
Property: CROSS_SSN=
{
"date": "2024-11-18T16:20:20+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A21.5189903Z'"",
"version": "2019-02-02"
}
Value type: DE01
System.String
Property: GSAP_OUCode=DE01
{
"date": "2024-11-18T16:20:22+00:00",
"etag": "W/"datetime'2024-11-18T16%3A20%3A22.9781421Z'"",
"version": "2019-02-02"
}
File input:
[
{
"PartitionKey": "C2S_CROSS_GSAP_OU_MAP",
"RowKey": "DEC-0154",
"CROSS_OUCode": "DEC",
"CROSS_TPPCode": "0154",
"CROSS_SSN": "",
"GSAP_OUCode": "DE01"
},
{
"PartitionKey": "C2S_CROSS_GSAP_OU_MAP",
"RowKey": "DEF-0154",
"CROSS_OUCode": "DEF",
"CROSS_TPPCode": "0154",
"CROSS_SSN": "",
"GSAP_OUCode": "DE01"
}
]
The field in question that is failing is "CROSS_TPPCode".
Expected behavior
String is entered as property, not int32
Environment Summary
azure-cli 2.63.0 *
core 2.63.0 *
telemetry 1.1.0
Dependencies:
msal 1.30.0
azure-mgmt-resource 23.1.1
Additional context
No response
The text was updated successfully, but these errors were encountered: