-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdapr-component.yaml
More file actions
51 lines (49 loc) · 1.56 KB
/
dapr-component.yaml
File metadata and controls
51 lines (49 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Example: Dapr Azure SQL state store component
# Apply to your cluster after creating the Kubernetes secret with the connection string.
#
# Prerequisites:
# 1. Azure SQL Server + database (create via Azure Portal or CLI)
# 2. Create K8s secret: kubectl create secret generic azuresql-secret \
# --from-literal=connectionString='Server=tcp:YOUR_SERVER.database.windows.net,1433;Database=YOUR_DB;User Id=YOUR_USER;Password=YOUR_PASSWORD;Encrypt=yes;'
# 3. Apply this component (same namespace as the secret)
#
# For production, use Azure AD (useAzureAD: true) with Managed Identity.
---
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
namespace: default
spec:
type: state.sqlserver
version: v1
metadata:
# Option 1: SQL Server credentials (development)
- name: connectionString
secretKeyRef:
name: azuresql-secret
key: connectionString
# Option 2: Azure AD (recommended for AKS)
# - name: useAzureAD
# value: "true"
# - name: connectionString
# value: "sqlserver://<server>.database.windows.net:1433?database=daprstate"
# - name: azureTenantId
# secretKeyRef:
# name: azure-ad-secret
# key: tenantId
# - name: azureClientId
# secretKeyRef:
# name: azure-ad-secret
# key: clientId
# - name: azureClientSecret
# secretKeyRef:
# name: azure-ad-secret
# key: clientSecret
# Optional metadata
- name: tableName
value: "state"
- name: schema
value: "dbo"
- name: keyLength
value: "200"