0

I'm trying to migrate from classic Azure Table Storage to Cosmos DB with Azure Table API. Starting on a particular data I want to start copying the current incoming Microsoft.WindowsAzure.Storage.Table.TableEntity objects to Cosmos DB at the same time I write to the existing Azure Table Storage.

Is there a way to convert Microsoft.WindowsAzure.Storage.Table.TableEntity to Microsoft.Azure.Cosmos.Table.TableEntity?

ProfNimrod
  • 4,142
  • 2
  • 35
  • 54
  • Please edit your question and include some code. – Gaurav Mantri Jan 25 '20 at 06:12
  • Does this answer your question? [cannot convert to microsoft.azure.cosmosDB.table.itableentity](https://stackoverflow.com/questions/48950037/cannot-convert-to-microsoft-azure-cosmosdb-table-itableentity). In all honesty even if you get rid of `WindowsAzure` and move to `CosmosDB`, the namespaces and methods are quite similar and shouldn't require too much changing. – RoadRunner Jan 25 '20 at 07:11
  • Thanks - the problem I have is that I want to be able to push the same data to both storage types for a period of time. Yes, just moving over completely is relatively trivial, but I'm not ready to do that yet. – ProfNimrod Jan 25 '20 at 17:28
  • In the end I just decided to serialize the Microsoft.WindowsAzure.Storage.Table.TableEntity objects and then deserialize them as Microsoft.Azure.Cosmos.Table.TableEntity. A bit hacky, but it works. – ProfNimrod Jan 26 '20 at 19:38

1 Answers1

0

AFAIK I don't think you can do that so I would use an Automapper to transfer the data between the two model objects.

Automapper

2d1b
  • 595
  • 1
  • 6
  • 24