Azure Table Storage

要设置 Azure Tablestorage 状态存储,请创建一个类型为的组件。 请参阅本指南,了解如何创建和应用状态存储配置。

Warning

以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.

元数据字段规范

如果你想创建一张表供Dapr使用,你可以事先这样做。 但是,当 Table Storage状态提供者会在其不存在时为你自动创建。

要将 Azure Table Storage配置为状态存储,你需要如下属性:

  • AccountName:存储账户名称 举例:mystorageaccount 举例:mystorageaccount
  • AccountKey:主要或次要存储密钥。
  • TableName:用于Dapr状态的表名称。 The name of the table to be used for Dapr state. The table will be created for you if it doesn’t exist 如果表不存在,将会自动创建

分区

这个状态存储在表存储中创建一个名为Value的列,并将原始状态放在里面。

例如,以下操作来自于名为myservice的服务

  1. curl -X POST http://localhost:3500/v1.0/state \
  2. -H "Content-Type: application/json"
  3. -d '[
  4. "key": "nihilus",
  5. "value": "darth"
  6. }
  7. ]'
PartitionKeyRowKey
myservicenihilusdarth

根据,Azure表存储状态并发是通过使用ETag实现的。

相关链接

  • 阅读 本指南 以获取配置状态存储组件的说明