PartitionKey was not specified in azure table storage

浪子不回头ぞ 提交于 2019-12-04 09:39:49

Azure Storage Key has been discussed here: Azure Table Storage Partition Key

In order to understand this, you will need to know what Partitions are. Whenever you upload something to Azure Storage, it is assigned to some partition. These partitions can be either on the same server or different server. The partitions can be moved across servers too. Lets assume that there are 5 servers in the pool and one of the servers (Server 2) is experiencing high load. Then Azure Storage will move the partition from Server 2 to another server to distribute the load evenly. It will also make this decision based on the size of data too.

In case of table storage, the user decides where the data is located. This is not the case for blobs or queues.

Therefore in table storage you will have to specify the partition key yourself.

I would suggest you to read these links in order to understand this topic further:

So in a way PartitionKey is used to specify on which partition you want to store your data. It acts as a unique identifier and forms a part of the Primary Key (first-half). RowKey is another attribute used to form the second half of the Primary Key. It identifies an entity in a given partition. So whenever you perform any opertion, you will need to specify both PartitionKey & RowKey.

Together the PartitionKey and RowKey uniquely identify every entity within a table.

Partition Key and Row Key specify the unique index of the row; The combination of the two must be unique. I suggest reading up a little more here for more details of them.

As Isaac Abraham mentioned each entity should have Partition Key and Row Key property and the combination of the two are unique for the table entity. It is mandatory. If we try to add the entity for the azure storage table with azure storage explorer tool we could see that,more detail please refer to the screenshot.

So If we try to import the .csv file, the format of the file should be have Column named PartitionKey and RowKey. And the names are case sensitive. The following is the .csv file demo

PartitionKey,RowKey,Column1,Column2
test,x,testdata,testdata
test,xx,testdata,testdata
test,xxx,testdata,testdata
test2,x,testdata,testdata

Note: There are also some Azure storage table limitation we should know when try to import the data, more details please refer to the azure document.

  • Max size of a table entity 1 MB
  • Max number of properties in a table entity 252

I recommend you change the region in Windows to English (U.S). So, you can save a spread-sheet as CSV-file with comma instead of semicolon as separator.

As example, if you are using Switzerland, you will get a CSV-file with semicolon as separator and azure will not find the Partitionkey.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!