Actor Azure dapr container app with Account storage account table not working

59 Views Asked by At

I configured Azure storage table for Actor statestore with below metadata value "name: actorStateStore" value: "true" , but getting the below error

Failed,Dapr.DaprApiException: the state store is not configured to use the actor runtime. Have you set the - name: actorStateStore value: "true" in your state store component file?

I see many examples with Redis configuration, will Azure storage table can used for Actor statestore?

1

There are 1 best solutions below

0
SiddheshDesai On

I referred this Github Document and was able to implement Azure container DAPR with storage State-store successfully:-

CLI Commands used:-

RESOURCE_GROUP="silicon-rg"
LOCATION="australiaeast"
CONTAINERAPPS_ENVIRONMENT="my-environment"
STORAGE_ACCOUNT_NAME="siliconrstrg75"
az containerapp env create --name $CONTAINERAPPS_ENVIRONMENT --resource-group $RESOURCE_GROUP --location "$LOCATION"

az storage account create --name $STORAGE_ACCOUNT_NAME --resource-group $RESOURCE_GROUP --location "$LOCATION" --sku Standard_RAGRS --kind StorageV2


az identity create --resource-group $RESOURCE_GROUP --name "xxxxtity" --output json

az role assignment create --assignee $PRINCIPAL_ID --role "Storage Blob Data Contributor" --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Storage/storageAccounts/$STORAGE_ACCOUNT_NAME"

az containerapp env dapr-component set \
    --name $CONTAINERAPPS_ENVIRONMENT --resource-group $RESOURCE_GROUP \
    --dapr-component-name statestore \
    --yaml statestore.yaml

az containerapp create \
  --name nodeapp \
  --resource-group $RESOURCE_GROUP \
  --user-assigned $IDENTITY_ID \
  --environment $CONTAINERAPPS_ENVIRONMENT \
  --image dapriosamples/hello-k8s-node:latest \
  --min-replicas 1 \
  --max-replicas 1 \
  --enable-dapr \
  --dapr-app-id nodeapp \
  --dapr-app-port 3000 \
  --env-vars 'APP_PORT=3000'

az containerapp create \
  --name pythonapp \
  --resource-group $RESOURCE_GROUP \
  --environment $CONTAINERAPPS_ENVIRONMENT \
  --image dapriosamples/hello-k8s-python:latest \
  --min-replicas 1 \
  --max-replicas 1 \
  --enable-dapr \
  --dapr-app-id pythonapp

Output:-

enter image description here

enter image description here

enter image description here

enter image description here

statestore.yaml:-

# statestore.yaml for Azure Blob storage component
componentType: state.azure.blobstorage
version: v1
metadata:
  - name: accountName
    value: "siliconrstrg75"
  - name: containerName
    value: mycontainer
  - name: azureClientId
    value: "xxxxxx44f-3cf40285a983"
scopes:
  - nodeapp

Check your statestore.yaml matches above file.

Logs:-

enter image description here