Perry Kankam is a Software Engineer for ThreeWill. Perry started out programming in C# and XML. Over the years, he has continuously added a variety of skills to his skillset including recent mobile application development technologies like Angular, React and Ionic.
I recently faced an issue with Azure table storage column types with date types and couldn’t find anything documented online to help resolve this issue, hence why I put this blog together; incase someone is dealing with the same problem.
After some digging, I found that the wrong dates are being fetched is because the Created and Modified date fields in the table are in String format instead of DateTime. The only way to get my queries to pull the right information was to modify all Dates in my table to the right format. You can manually change field types one at a time in Azure Table Storage but that will take forever if you have even 100+ items.
Steps to Update and Fix Azure Table Storage Column Type in Bulk
Export table data
To do this, click export in the top pane. It’ll download as a csv with “.typed.csv” extension.
Understand field types
Upon opening the excel file, you’d realize each of the fields have their respective field types next to them(“FieldName” + @type).
Update the type column
Highlight all affected rows and update the type column from Edm.String to Edm.DateTime or whatever type you need to update it to. Once complete, save file and import into Azure Table Storage.
Open one of the table records after import is complete to confirm it’s showing the right type. You can also use this process to update field values if needed.