Azure Workload Identity
Configure Azure Workload Identity for Spice.ai on AKS.
Azure Workload Identity allows Spice.ai pods on Azure Kubernetes Service (AKS) to authenticate with Azure services (Blob Storage, Key Vault, etc.) using federated credentials.
Configuration
Annotate the Spice ServiceAccount with the Azure managed identity client ID, and label the Spice pods with azure.workload.identity/use: "true". The AKS workload identity webhook injects the AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_FEDERATED_TOKEN_FILE environment variables only into pods that carry this label.
Helm Chart
additionalLabels applies to the Spice pods as well as the other chart resources:
serviceAccount:
create: true
annotations:
azure.workload.identity/client-id: <AZURE_CLIENT_ID>
additionalLabels:
azure.workload.identity/use: "true"SpicepodSet (Kubernetes Operator)
spec.labels applies to every resource the operator creates for the SpicepodSet, the pods included:
apiVersion: spice.ai/v2
kind: SpicepodSet
metadata:
name: my-spicepod
spec:
replicas: 1
labels:
azure.workload.identity/use: "true"
serviceAccount:
enabled: true
create: true
annotations:
azure.workload.identity/client-id: <AZURE_CLIENT_ID>
spicepod:
name: my-spicepod
kind: Spicepod
version: v1Azure Key Vault
The Azure Key Vault secret store does not select workload identity by default. Set auth_method: workload_identity:
secrets:
- from: azure_keyvault:my-vault
name: azure
params:
auth_method: workload_identityWhen client_id and tenant_id are not set, the secret store reads them from the AZURE_CLIENT_ID and AZURE_TENANT_ID variables that the webhook injects.
Prerequisites
- Enable the Azure Workload Identity add-on on your AKS cluster.
- Create a managed identity and federated credential.
- Assign the necessary roles to the managed identity for the Azure resources your Spicepod accesses.
See Azure Workload Identity documentation for full setup instructions.