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
1. Edit the _Web.config_ file. Then add the following content:
76
+
77
+
```json
78
+
"_redisHostName":"<cache-hostname>"
79
+
```
80
+
81
+
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview section of the Resource menu in the Azure portal. For example, _my-redis.eastus.azure.net:10000_.
82
+
83
+
1. Save the file.
84
+
85
+
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
86
+
87
+
::: zone-end
88
+
89
+
::: zone pivot="azure-cache-redis"
90
+
73
91
### To edit the _appsettings.json_ file
74
92
75
93
1. Edit the _Web.config_ file. Then add the following content:
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
### Install the Library for using Microsoft Entra ID Authentication
54
46
55
47
The [Azure.StackExchange.Redis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) library contains the Microsoft Entra ID authentication method for connecting to Azure Redis services using Microsoft Entra ID. It's applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
1. Create a file on your computer named *CacheSecrets.config*. Put it in a location where it won't be checked in with the source code of your sample application. For this quickstart, the *CacheSecrets.config* file is located at *C:\AppSecrets\CacheSecrets.config*.
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
97
95
96
+
::: zone pivot="azure-cache-redis"
97
+
98
+
::: zone-end
99
+
100
+
### To edit the *CacheSecrets.config* file
101
+
102
+
1. Create a file on your computer named *CacheSecrets.config*. Put it in a location where it won't be checked in with the source code of your sample application. For this quickstart, the *CacheSecrets.config* file is located at *C:\AppSecrets\CacheSecrets.config*.
103
+
104
+
1. Edit the *app.config* file. Then add the following content:
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview from the Resource menu in Azure portal. For example, *my-redis.eastus.azure.net:6380*
113
+
114
+
1. Save the file.
115
+
116
+
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
Formoreinformation, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
Formoreinformation, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
1. Create a file on your computer named *CacheSecrets.config*. Put it in a location where it isn't checked in with the source code of your sample application. For this quickstart, the *CacheSecrets.config* file is located at _C:\AppSecrets\CacheSecrets.config_.
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
87
89
90
+
::: zone-end
91
+
92
+
::: zone pivot="azure-cache-redis"
93
+
94
+
### To edit the *CacheSecrets.config* file
95
+
96
+
1. Create a file on your computer named *CacheSecrets.config*. Put it in a location where it isn't checked in with the source code of your sample application. For this quickstart, the *CacheSecrets.config* file is located at _C:\AppSecrets\CacheSecrets.config_.
97
+
98
+
1. Edit the *Web.config* file. Then add the following content:
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview on the Resource menu in Azure portal. For example, *my-redis.eastus.azure.net:10000*
107
+
108
+
1. Save the file.
109
+
110
+
For more information, see [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) and the code in a [GitHub repo](https://github.com/StackExchange/StackExchange.Redis).
111
+
::: zone-end
112
+
88
113
## Run the app locally
89
114
90
115
By default, the project is configured to host the app locally in [IIS Express](/iis/extensions/introduction-to-iis-express/iis-express-overview) for testing and debugging.
0 commit comments