Skip to content

Commit 5a054b9

Browse files
Update tutorial based on code sample changes.
1 parent b71ec8d commit 5a054b9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

articles/azure-cache-for-redis/cache-tutorial-aks-get-started.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ In this tutorial, you adapt the [AKS sample voting application](https://github.c
3535

3636
1. Take note of the user name for your Redis user from the portal. You use this user name with the AKS workload.
3737

38+
## Run sample locally
39+
40+
To run this sample locally, configure your user principal as a Redis User on your Redis instance. The code sample will use your user principal through (DefaultAzureCredential)[https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication/?tabs=command-line#use-defaultazurecredential-in-an-application] to connect to Redis instance.
41+
3842
## Configure your AKS cluster
3943

4044
Follow these [steps](/azure/aks/workload-identity-deploy-cluster) to configure a workload identity for your AKS cluster. Complete the following steps:
@@ -101,7 +105,7 @@ If you use Azure Cloud Shell, _kubectl_ is already installed, and you can skip t
101105

102106
## Run your workload
103107

104-
1. The following code describes the pod specification file that you use to run our workload. Take note that the pod has the label _azure.workloadidentity/use: "true"_ and is annotated with _serviceAccountName_ as required by AKS workload identity. Replace the value of CONNECTION_STRING, CACHE_NAME and USER_ASSIGNED_PRINCIPAL_ID environment variables that correspond with your cache and managed identity.
108+
1. The following code describes the pod specification file that you use to run our workload. Take note that the pod has the label _azure.workloadidentity/use: "true"_ and is annotated with _serviceAccountName_ as required by AKS workload identity. When using access key authentication, replace the value of AUTHENTICATION_TYPE, REDIS_HOSTNAME and REDIS_ACCESSKEY environment variables.
105109

106110
```yml
107111
apiVersion: v1
@@ -125,12 +129,14 @@ If you use Azure Cloud Shell, _kubectl_ is already installed, and you can skip t
125129
memory: "128Mi"
126130
cpu: "250m"
127131
env:
128-
- name: CONNECTION_OPTION
129-
value: "MANAGED_IDENTITY" #ACCESS_KEY
130-
- name: CONNECTION_STRING # Required when connecting with access key
131-
value: "your connection string"
132-
- name: CACHE_NAME
133-
value: "your cache name"
132+
- name: AUTHENTICATION_TYPE
133+
value: "MANAGED_IDENTITY" # change to ACCESS_KEY to authenticate using access key
134+
- name: REDIS_HOSTNAME
135+
value: "your redis hostname"
136+
- name: REDIS_ACCESSKEY
137+
value: "your access key"
138+
- name: REDIS_PORT
139+
value: "6380"
134140
restartPolicy: Never
135141
136142
```

0 commit comments

Comments
 (0)