Open JackBruceShell opened 4 days ago
Hi @JackBruceShell,
2.63.0 is not the latest Azure CLI(2.66.0).
If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.
storage
Hi @JackBruceShell Seems like it is auto resolving the value type, can you try adding quotes around this string?
Adding quotes would store data with quotes '0123', Cant we just store 0123
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 $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 { $ht2[$.Name] = $.Value } 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