Azure Table Storage
To setup Azure Tablestorage state store create a component of type . See this guide on how to create and apply a state store configuration.
Warning
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.
Spec metadata fields
Follow the instructions from the Azure documentation on how to create an Azure Storage Account.
In order to setup Azure Table Storage as a state store, you will need the following properties:
- AccountName: The storage account name. For example: mystorageaccount.
- AccountKey: Primary or secondary storage key.
- TableName: The name of the table to be used for Dapr state. The table will be created for you if it doesn’t exist.
Partitioning
The Azure Table Storage state store uses the key
property provided in the requests to the Dapr API to determine the row key
. Service Name is used for . This provides best performance, as each service type stores state in it’s own table partition.
This state store creates a column called Value
in the table storage and puts raw state inside it.
curl -X POST http://localhost:3500/v1.0/state \
-H "Content-Type: application/json"
-d '[
"key": "nihilus",
"value": "darth"
}
]'
will create the following record in a table:
PartitionKey | RowKey | Value |
---|---|---|
myservice | nihilus | darth |
Azure Table Storage state concurrency is achieved by using ETag
s according to the official documentation.
Related links
- Basic schema for a Dapr component
- Read for instructions on configuring state store components