简体   繁体   English

通过 Azure 表中的分区键删除实体

[英]Delete entities by partition key in Azure Tables

I am currently migrating web configs to Azure Tables.我目前正在将 web 配置迁移到 Azure 表。 I have a selection of entities sectioned by partition key.我有一些按分区键划分的实体。

Instead of updating these config entities when changes needed to be made, I was wondering if it's possible to delete all entities based on their specific partition key and then adding them again based on their partition key?我想知道是否可以根据其特定的分区键删除所有实体,然后根据其分区键再次添加它们,而不是在需要进行更改时更新这些配置实体?

I can't seem to find anything that would indicate that I can within the documentation or within other sources.我似乎无法在文档或其他来源中找到任何表明我可以的东西。

I was wondering if it's possible to delete all entities based on their specific partition key and then adding them again based on their partition key?我想知道是否可以根据其特定的分区键删除所有实体,然后根据其分区键再次添加它们?

If you're looking to delete all entities in a partition (ie having same partition key value) with a single command, it is not possible.如果您希望使用单个命令删除分区中的所有实体(即具有相同的分区键值),这是不可能的。 You will need to delete each entity separately.您将需要分别删除每个实体。

You can however speed up the operation by using Entity Group Transaction where you can delete up to 100 entities in a single operation.但是,您可以通过使用Entity Group Transaction来加快操作,在该事务中您可以在一次操作中删除多达 100 个实体。 You can also use entity group operation to create 100 entities having same partition key in a single operation.您还可以使用实体组操作在单个操作中创建 100 个具有相同分区键的实体。

You can learn more about the entity group transaction here: https://docs.microsoft.com/en-us/rest/api/storageservices/performing-entity-group-transactions .您可以在此处了解有关实体组事务的更多信息: https://docs.microsoft.com/en-us/rest/api/storageservices/performing-entity-group-transactions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM