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/azure-cache-for-redis/cache-python-get-started.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,21 +37,21 @@ The following example used `pip3` for Python 3 to install `redis-py` on Windows
37
37
38
38
:::image type="content" source="media/cache-python-get-started/cache-python-install-redis-py.png" alt-text="Screenshot of a terminal showing an install of redis-py interface to Azure Cache for Redis.":::
## Enable EntraID and add a User or Service Principal
42
+
## Enable Microsoft EntraID and add a User or Service Principal
43
43
<--Fran, we probably need an include file on enabling EntraID-->
44
-
Blah blah blah, do the steps listed [here](cache-azure-active-directory-for-authentication.md)
44
+
Blah blah blah, do the steps listed [here](cache-azure-active-directory-for-authentication)
45
45
46
46
## Install the Microsoft Authentication Library
47
-
The [Microsoft Authentication Library (MSAL)](../../entra/identity-platform/msal-overview.md) allows you to acquire security tokens from Microsoft identity to authenticate users. There is a [Python Azure idenitty client library](../../python/api/overview/azure/identity-readme.md) available that uses MSAL to provide token authentication support. Install this library using `pip`:
47
+
The [Microsoft Authentication Library (MSAL)](../../entra/identity-platform/msal-overview) allows you to acquire security tokens from Microsoft identity to authenticate users. There's a [Python Azure identity client library](../../python/api/overview/azure/identity-readme) available that uses MSAL to provide token authentication support. Install this library using `pip`:
48
48
49
49
```python
50
50
pip install azure-identity
51
51
```
52
52
53
53
## Create a sample python app
54
-
Create a new text file, add the following script, and save the file as `PythonApplication1.py`. Replace `<Your Host Name>` with the value from your Azure Cache for Redis instance. Your host name is of the form `<DNS name>.redis.cache.windows.net`. Replace `<Your Username>` with the values from your EntraID user.
54
+
Create a new text file, add the following script, and save the file as `PythonApplication1.py`. Replace `<Your Host Name>` with the value from your Azure Cache for Redis instance. Your host name is of the form `<DNS name>.redis.cache.windows.net`. Replace `<Your Username>` with the values from your Microsoft EntraID user.
55
55
56
56
```python
57
57
import redis
@@ -94,10 +94,10 @@ Run `PythonApplication1.py` with Python. You should see results like the followi
94
94
95
95
:::image type="content" source="media/cache-python-get-started/cache-python-completed.png" alt-text="Screenshot of a terminal showing a Python script to test cache access.":::
96
96
97
-
## Create a sample python app with re-authentication
98
-
EntraID access tokens have limited lifespans, [averaging 75 minutes](../../entra/identity-platform/configurable-token-lifetimes#token-lifetime-policies-for-access-saml-and-id-tokens). In order to maintain a connection to your cache, you need to refresh the token. This example demonstrates how to do this using Python.
97
+
## Create a sample python app with reauthentication
98
+
Microsoft EntraID access tokens have limited lifespans, [averaging 75 minutes](../../entra/identity-platform/configurable-token-lifetimes#token-lifetime-policies-for-access-saml-and-id-tokens). In order to maintain a connection to your cache, you need to refresh the token. This example demonstrates how to do this using Python.
99
99
100
-
Create a new text file, add the following script, and save the file as `PythonApplication2.py`. Replace `<Your Host Name>` with the value from your Azure Cache for Redis instance. Your host name is of the form `<DNS name>.redis.cache.windows.net`. Replace `<Your Username>` with the values from your EntraID user.
100
+
Create a new text file, add the following script, and save the file as `PythonApplication2.py`. Replace `<Your Host Name>` with the value from your Azure Cache for Redis instance. Your host name is of the form `<DNS name>.redis.cache.windows.net`. Replace `<Your Username>` with the values from your Microsoft EntraID user.
101
101
102
102
```python
103
103
import time
@@ -168,7 +168,7 @@ Run `PythonApplication2.py` with Python. You should see results like the followi
168
168
169
169
:::image type="content" source="media/cache-python-get-started/cache-python-completed.png" alt-text="Screenshot of a terminal showing a Python script to test cache access.":::
170
170
171
-
Unlike the first example, If your token has expired, this example will automatically refersh it.
171
+
Unlike the first example, If your token expires, this example automatically refreshes it.
0 commit comments