Inserting a table storage (emulator) does not work: "One of the request inputs is invalid."

I have an import process that takes data from an old source and puts it in a table store, which allows me to reload the table store and start over as needed. It worked before upgrading to the October Azure SDK for .NET (VS2012). Now it fails after inserting several entities (it seems to change, the imported data is not static in nature). The first object of the same type is always inserted successfully. Partition keys are unique, and the RowKey for each is an empty string (but not null). It does not work specifically on SaveChangesWithRetries() . Are there any changes to the new SDK that would be incompatible with what I did before?

Update

I checked the actual XML of the successfully inserted rows by querying the table storage database. One thing I noticed is that a column with a null int in essence has SqlType nvarchar(max) when it is null, and int when it is not null. Is this intended?

+3
source share
3 answers

So, I was able to successfully reproduce the error on an ongoing basis, and it turned out that this is a rather unpleasant error that appeared in the SDK in October 2012.

Any line ending with a space will throw an exception. Calling Trim () on all string inputs solved this problem.

+8
source

This is certainly one of the problems with the emulator. As you may know, it simulates storing tables in SQL Server. This works in most cases, but when you try to do something special, such as adding additional properties, or in your case, just mix the NULL values ​​and not the NULL values ​​in the properties, they usually go bad.

This page explains the differences between the actual table storage service and the implementation in the emulator. But your problem is not documented yet. You will find many reports of problems with the Table Storage emulator (also here on fooobar.com/questions/1445083 / ... ).

The only solution for you is to develop with a real storage account instead of using an emulator.

+1
source

This issue has been fixed in later versions of the Windows Azure SDK. Install the latest version to fix the problem. http://www.windowsazure.com/en-us/downloads/

+1
source

Source: https://habr.com/ru/post/1445079/


All Articles