Skip to content

Commit e355613

Browse files
committed
fix broken build stuff
1 parent 5888f2a commit e355613

File tree

4 files changed

+96
-17
lines changed

4 files changed

+96
-17
lines changed

articles/azure-cache-for-redis/cache-dotnet-core-quickstart.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ Clone the repo [https://github.com/Azure-Samples/azure-cache-redis-samples/tree/
3939

4040
::: zone-end
4141

42-
## Microsoft Entra ID Authentication (recommended)
43-
4442
[!INCLUDE [cache-entra-access](includes/cache-entra-access.md)]
4543

4644
### Install the Library for using Microsoft Entra ID Authentication
@@ -70,6 +68,26 @@ ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(
7068
IDatabase Database = _newConnection.GetDatabase();
7169
```
7270

71+
::: zone pivot="azure-managed-redis"
72+
73+
### To edit the _appsettings.json_ file
74+
75+
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+
7391
### To edit the _appsettings.json_ file
7492

7593
1. Edit the _Web.config_ file. Then add the following content:
@@ -83,6 +101,7 @@ IDatabase Database = _newConnection.GetDatabase();
83101
1. Save the file.
84102

85103
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).
104+
::: zone-end
86105

87106
## Run the sample
88107

articles/azure-cache-for-redis/cache-dotnet-how-to-use-azure-redis-cache.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,8 @@ Clone the repo from [Azure-Samples/azure-cache-redis-samples](https://github.com
4040

4141
::: zone-end
4242

43-
## Microsoft Entra ID Authentication (recommended)
44-
4543
[!INCLUDE [cache-entra-access](includes/cache-entra-access.md)]
4644

47-
<!-- ## [Access Key Authentication](#tab/accesskey) -->
48-
49-
[!INCLUDE [redis-access-key-alert](includes/redis-access-key-alert.md)]
50-
51-
<!-- [!INCLUDE [redis-cache-passwordless](includes/redis-cache-passwordless.md)] -->
52-
5345
### Install the Library for using Microsoft Entra ID Authentication
5446

5547
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).
@@ -63,20 +55,26 @@ dotnet add package Microsoft.Azure.StackExchangeRedis
6355
### Connect to the cache using Microsoft Entra ID
6456

6557
1. Include the libraries in your code
66-
67-
```
58+
59+
```csharp
6860
using Azure.Identity;
6961
using StackExchange.Redis
7062
```
7163

7264
1. Using the default Azure credentials to authenticate the client connection. This enables your code to use the signed-in user credential when running locally, and an Azure managed identity when running in Azure without code change.
73-
65+
7466
```csharp
7567
var configurationOptions = await ConfigurationOptions.Parse($"{_redisHostName}").ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
7668
ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
7769
IDatabase Database = _newConnection.GetDatabase();
7870
```
7971

72+
::: zone pivot="azure-managed-redis"
73+
74+
75+
::: zone-end
76+
77+
8078
### To edit the *CacheSecrets.config* file
8179

8280
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*.
@@ -95,6 +93,27 @@ IDatabase Database = _newConnection.GetDatabase();
9593

9694
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).
9795

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:
105+
106+
```xml
107+
<appSettings>
108+
<add key="RedisHostName" value="<cache-hostname-with-portnumber>"/>
109+
</appSettings>
110+
```
111+
112+
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).
98117

99118
## Run the sample
100119

articles/azure-cache-for-redis/cache-web-app-aspnet-core-howto.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ dotnet add package Microsoft.Azure.StackExchangeRedis
8080
IDatabase Database = _newConnection.GetDatabase();
8181
```
8282

83+
::: zone pivot="azure-managed-redis"
84+
8385
### To edit the _appsettings.json_ file
8486

8587
1. Edit the _Web.config_ file. Then add the following content:
@@ -90,22 +92,36 @@ dotnet add package Microsoft.Azure.StackExchangeRedis
9092

9193
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal.
9294

93-
::: zone pivot="azure-managed-redis"
94-
9595
For example, with Azure Managed Redis or the Enterprise tiers: _my-redis.eastus.azure.net:10000_
9696

97+
1. Save the file.
98+
99+
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).
100+
97101
::: zone-end
98102

99103
::: zone pivot="azure-cache-redis"
100104

101-
For example, with Azure Cache for Redis: _my-redis.eastus.azure.net:6380_
105+
### To edit the _appsettings.json_ file
102106

103-
::: zone-end
107+
1. Edit the _Web.config_ file. Then add the following content:
108+
109+
```json
110+
"_redisHostName":"<cache-hostname>"
111+
```
112+
113+
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal.
114+
115+
For example, with Azure Cache for Redis: _my-redis.eastus.azure.net:6380_
104116

105117
1. Save the file.
106118

107119
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).
108120
121+
::: zone-end
122+
123+
### To edit the _appsettings.json_ file
124+
109125
## Run the app locally
110126

111127
1. Execute the following command in your command window to build the app:

articles/azure-cache-for-redis/cache-web-app-howto.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(
6767
IDatabase Database = _newConnection.GetDatabase();
6868
```
6969

70+
::: zone pivot="azure-managed-redis"
71+
7072
### To edit the *CacheSecrets.config* file
7173

7274
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_.
@@ -85,6 +87,29 @@ IDatabase Database = _newConnection.GetDatabase();
8587

8688
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).
8789

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:
99+
100+
```xml
101+
<appSettings>
102+
<add key="RedisHostName" value="<cache-hostname-with-portnumber>"/>
103+
</appSettings>
104+
```
105+
106+
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+
88113
## Run the app locally
89114

90115
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

Comments
 (0)