Add Table Storage documentation for AAD and Cosmos DB Table API (#2564)

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
Bernd Verst 2022-06-23 22:31:23 -07:00 committed by GitHub
parent 2e8c3a7b58
commit f55a8603cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 8 deletions

View File

@ -47,7 +47,7 @@ If you wish to use Cosmos DB as an actor store, append the following to the yam
| Field | Required | Details | Example |
|--------------------|:--------:|---------|---------|
| url | Y | The Cosmos DB url | `"https://******.documents.azure.com:443/"`.
| masterKey | Y | The key to authenticate to the Cosmos DB account | `"key"`
| masterKey | Y* | The key to authenticate to the Cosmos DB account. Only required when not using Azure AD authentication. | `"key"`
| database | Y | The name of the database | `"db"`
| collection | Y | The name of the collection (container) | `"collection"`
| actorStateStore | N | Consider this state store for actors. Defaults to `"false"` | `"true"`, `"false"`
@ -67,7 +67,7 @@ You can read additional information for setting up Cosmos DB with Azure AD aut
In order to setup Cosmos DB as a state store, you need the following properties:
- **URL**: the Cosmos DB url. for example: `https://******.documents.azure.com:443/`
- **Master Key**: The key to authenticate to the Cosmos DB account
- **Master Key**: The key to authenticate to the Cosmos DB account. Skip this if using Azure AD authentication.
- **Database**: The name of the database
- **Collection**: The name of the collection (or container)

View File

@ -2,7 +2,7 @@
type: docs
title: "Azure Table Storage "
linkTitle: "Azure Table Storage "
description: Detailed information on the Azure Table Storage state store component
description: Detailed information on the Azure Table Storage state store component which can be used to connect to Cosmos DB Table API and Azure Tables
aliases:
- "/operations/components/setup-state-store/supported-state-stores/setup-azure-tablestorage/"
---
@ -27,6 +27,8 @@ spec:
value: <REPLACE-WITH-ACCOUNT-KEY>
- name: tableName
value: <REPLACE-WITH-TABLE-NAME>
- name: cosmosDbMode
value: false
```
{{% alert title="Warning" color="warning" %}}
@ -39,18 +41,41 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|--------------------|:--------:|---------|---------|
| accountName | Y | The storage account name | `"mystorageaccount"`.
| accountKey | Y | Primary or secondary storage key | `"key"`
| tableName | Y | The name of the table to be used for Dapr state. The table will be created for you if it doesn't exist | `"table"`
| tableName | Y | The name of the table to be used for Dapr state. The table will be created for you if it doesn't exist | `"table"`
| cosmosDbMode | N | If enabled, connects to Cosmos DB Table API instead of Azure Tables (Storage Accounts). Defaults to `false`. | `"false"`
| serviceURL | N | The full storage service endpoint URL. Useful for Azure environments other than public cloud. | `"https://mystorageaccount.table.core.windows.net/"`
| skipCreateTable | N | Skips the check for and, if necessary, creation of the specified storage table. This is useful when using active directory authentication with minimal privileges. Defaults to `false`. | `"true"`
## Setup Azure Table Storage
### Azure Active Directory (Azure AD) authentication
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]({{< ref authenticating-azure.md >}}).
You can read additional information for setting up Cosmos DB with Azure AD authentication in the [section below](#setting-up-cosmos-db-for-authenticating-with-azure-ad).
## Option 1: Setup Azure Table Storage
[Follow the instructions](https://docs.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-portal) from the Azure documentation on how to create an Azure Storage Account.
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.
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.
- **TableName**: The name of the table to be used for Dapr state. The table will be created for you if it doesn't exist.
- **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](https://docs.microsoft.com/azure/cosmos-db/table/how-to-use-python?tabs=azure-portal#1---create-an-azure-cosmos-db-account) 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.
In order to setup Azure Cosmos DB Table API as a state store, you will need the following properties:
- **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.
## Partitioning