Skip to main content

Deploying state stores

In this section, you'll learn how to set up an internal state store.

Prerequisites

  • A Taskurai installation (Taskurai instance, Taskurai CLI, ...). See Taskurai Setup.

Setup the configuration file

  1. Navigate to the folder containing the taskurai.yaml configuration file or create a new file using the taskurai CLI command:
taskurai
  1. Copy the installation information from your Taskurai setup to the solution file:
taskurai-workers/Taskurai.yaml
options:
taskurai:
accountId: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
instanceId: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
deployment:
deploySecrets: false
state:
defaultStateStore: DefaultStateStore
hubs:
DefaultHub:
description: Default Compute and State Hub
type: External
kind: AzureManagedHub
stateStores:
DefaultStateStore:
type: DefaultStateStore
kind: Dedicated
hub: DefaultHub
environment:
- name: accountName
secretReference:
value: default
- name: storageTier
secretReference:
value: Standard_LRS
- name: containerName
secretReference:
value: default

Deploy state store to Taskurai

Next, deploy the state store to Taskurai using the CLI:

taskurai statestore deploy
info

The number and kind of supported state stores is depending on your Taskurai plan.

Testing your setup

To verify that the state store has been successfully deployed to Taskurai, use the following command:

taskurai statestores show --name DefaultStateStore

When the deployment is successful, you should see output similar to the following:

# Signed into Taskurai

DefaultStateStore
├── General
│ └── ╭────────────────────┬───────────────────╮
│ │ Setting │ Value │
│ ├────────────────────┼───────────────────┤
│ │ Name │ DefaultStateStore │
│ │ Type │ DefaultStateStore │
│ │ Kind │ Dedicated │
│ │ Provisioning State │ Succeeded │
│ │ Hub │ DefaultHub │
│ ╰────────────────────┴───────────────────╯
├── Secrets
│ └── ╭─────────╮
│ │ Secrets │
│ ╰─────────╯
├── Environment
│ └── ╭───────────────┬─────────────────┬──────────────╮
│ │ Name │ SecretReference │ Value │
│ ├───────────────┼─────────────────┼──────────────┤
│ │ accountName │ null │ default │
│ │ storageTier │ null │ Standard_LRS │
│ │ containerName │ null │ default │
│ ╰───────────────┴─────────────────┴──────────────╯
└── Scopes
└── ╭────────╮
│ Scopes │
╰────────╯

That's it! You have successfully deployed a state store to Taskurai.

Advanced setup

Dedicated states store can be configured to either share or have dedicated database and storage accounts. Dedicated state stores support standard or premium storage accounts.

In this example, the first two state store share a database and storage account:

  • ConfigState: Shared standard storage account custom with tier Standard_LRS. The name configstate is used for the database and storage container name.
  • TranscriptionsState: Shared standard storage account custom with tier Standard_LRS. The name transcriptionsstate is used for the database and storage container name.

The last two state stores have a dedicated database and premium storage account:

  • AudioState: Premium storage account premiuma with tier Premium_ZRS. The name premiumaudio is used for the database and storage container name.
  • VideoState: Shared standard storage account premiumv with tier Premium_ZRS. The name premiumvideo is used for the database and storage container name.
stateStores:
ConfigState:
type: DefaultStateStore
kind: Dedicated
hub: DefaultHub
environment:
- name: accountName
value: custom
- name: storageTier
value: Standard_LRS
- name: containerName
value: configstate
TranscriptionsState:
type: DefaultStateStore
kind: Dedicated
hub: DefaultHub
environment:
- name: accountName
value: custom
- name: storageTier
value: Standard_LRS
- name: containerName
value: transcriptionsstate
AudioState:
type: DefaultStateStore
kind: Dedicated
hub: DefaultHub
environment:
- name: accountName
value: premiuma
- name: storageTier
value: Premium_ZRS
- name: containerName
value: premiumaudio
VideoState:
type: DefaultStateStore
kind: Dedicated
hub: DefaultHub
environment:
- name: accountName
value: premiumv
- name: storageTier
value: Premium_ZRS
- name: containerName
value: premiumvideo

More information

Read the section State store configuration to learn more about the configuration options.