You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/redis/go-get-started.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,12 +16,12 @@ zone_pivot_groups: redis-type
16
16
17
17
# Quickstart: Use Azure Redis with Go
18
18
19
-
In this article, you learn how to use a Azure Redis cache with the Go language and connect using Microsoft Entra ID.
19
+
In this article, you learn how to use an Azure Redis cache with the Go language and connect using Microsoft Entra ID.
20
20
21
21
## Prerequisites
22
22
23
23
- Azure subscription - [create one for free](https://azure.microsoft.com/free/)
24
-
-[Go](https://go.dev/doc/install)
24
+
-[Go](https://go.dev/doc/install)
25
25
- You must also add two imports from Redis to your project and add them to your development environment.
26
26
-`entraid "github.com/redis/go-redis-entraid"`
27
27
-`"github.com/redis/go-redis/v9"`
@@ -30,16 +30,16 @@ In this article, you learn how to use a Azure Redis cache with the Go language a
30
30
31
31
First you must create a cache. You can create a cache using Azure Managed Redis or Azure Cache for Redis using the Azure portal. In this Quickstart, we use Azure Managed Redis.
32
32
33
-
When you create the cache you should create it Microsoft Entra ID is enabled by default. Your cache must also use public endpoint for this QuickStart.
33
+
When you create the cache, you should create it Microsoft Entra ID is enabled by default. Your cache must also use public endpoint for this QuickStart.
34
34
35
-
To create a chace with the portal, follow one of these procedure
35
+
To create a cache with the portal, follow one of these procedures:
-[Azure Cache for Redis](/azure/azure-cache-for-redis/quickstart-create-redis)
39
39
40
40
Optionally, you can create a cache using Azure CLI, PowerShell, or any means that you prefer.
41
41
42
-
## Code to connect to a AMR Cache
42
+
## Code to connect to a Redis cache
43
43
44
44
The first part of the code sample, you set your connection to your cache:
45
45
@@ -95,7 +95,7 @@ In the next section, we test the connection using the Redis command "ping" that
95
95
96
96
## Code set a key, get a key
97
97
98
-
In this section, we show a basic `set` and `get` sequence to demonstrte using the Redis cache.
98
+
In this section, we show a basic `set` and `get` sequence to demonstrate using the Redis cache.
99
99
100
100
```go
101
101
// Do something with Redis and a key-value pair
@@ -120,7 +120,7 @@ In this section, we show a basic `set` and `get` sequence to demonstrte using th
120
120
121
121
```
122
122
123
-
Before you can run this code, you must add yourself as a Redis user. And you must also authorize your connection to Azure from the command line using the Azure command line or Azure developer command line (azd).
123
+
Before you can run this code, you must add yourself as a Redis user. And you must also authorize your connection to Azure from the command line using the Azure command line or Azure developer command line (azd).
124
124
125
125
You should also [add any user](entra-for-authentication.md)[Add users or System principal to your cache](entra-for-authentication.md#add-users-or-system-principal-to-your-cache) who might run the program as a user on the Redis cache.
126
126
@@ -131,6 +131,7 @@ Ping returned: PONG
131
131
SET Message succeeded: OK
132
132
GET Message returned: Hello, The cache is working with Go!
133
133
```
134
+
134
135
You can see this code sample in its entirety.
135
136
136
137
```go
@@ -204,4 +205,4 @@ func main() {
204
205
## Related content
205
206
206
207
- [Redis Extension for connecting using Microsoft Entra ID](https://github.com/redis/go-redis-entraid)
0 commit comments