Azure Table Storage

To setup Azure Tablestorage state store create a component of type . See 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 .

Spec metadata fields

The Azure Cosmos DB state store component supports authentication using all Azure Active Directory mechanisms. For further information and the relevant component metadata fields to provide depending on the choice of Azure AD authentication mechanism, see the docs for authenticating to Azure.

You can read additional information for setting up Cosmos DB with Azure AD authentication in the .

If you wish to create a table for Dapr to use, you can do so beforehand. However, Table Storage state provider will create one for you automatically if it doesn’t exist, unless the skipCreateTable option is enabled.

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. Skip this if using Azure AD authentication.
  • TableName: The name of the table to be used for Dapr state. The table will be created for you if it doesn’t exist, unless the skipCreateTable option is enabled.
  • cosmosDbMode: Set this to false to connect to Azure Tables.

Option 2: Setup Azure Cosmos DB Table API

Follow the instructions from the Azure documentation on creating a Cosmos DB account with Table API.

If you wish to create a table for Dapr to use, you can do so beforehand. However, Table Storage state provider will create one for you automatically if it doesn’t exist, unless the skipCreateTable option is enabled.

  • AccountName: The Cosmos DB account name. For example: mycosmosaccount.
  • AccountKey: The Cosmos DB master key. Skip this if using Azure AD authentication.
  • TableName: The name of the table to be used for Dapr state. The table will be created for you if it doesn’t exist, unless the skipCreateTable option is enabled.
  • cosmosDbMode: Set this to true to connect to Azure Tables.

The Azure Table Storage state store uses the key property provided in the requests to the Dapr API to determine the . Service Name is used for partition key. 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.

For example, the following operation coming from service called myservice

  1. -H "Content-Type: application/json"
  2. -d '[
  3. {
  4. "key": "nihilus",
  5. "value": "darth"
  6. }

will create the following record in a table:

PartitionKeyRowKeyValue
myservicenihilusdarth

Concurrency