Skip to content

Commit 5888f2a

Browse files
committed
acrolinx, revisions for include
1 parent 9db63ae commit 5888f2a

File tree

4 files changed

+65
-74
lines changed

4 files changed

+65
-74
lines changed

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

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,62 +43,56 @@ Clone the repo [https://github.com/Azure-Samples/azure-cache-redis-samples/tree/
4343

4444
[!INCLUDE [cache-entra-access](includes/cache-entra-access.md)]
4545

46-
<!-- ## [Access Key Authentication](#tab/accesskey) -->
46+
### Install the Library for using Microsoft Entra ID Authentication
4747

48-
[!INCLUDE [redis-access-key-alert](includes/redis-access-key-alert.md)]
49-
50-
<!-- [!INCLUDE [redis-cache-passwordless](includes/redis-cache-passwordless.md)] -->
51-
52-
### Install the Library for using Entra ID Authentication
53-
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 Entra ID. It is applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
48+
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).
5449

5550
```cli
5651
dotnet add package Microsoft.Azure.StackExchangeRedis
5752
```
5853

5954
---
6055

61-
## Connect to the cache using Entra ID
56+
## Connect to the cache using Microsoft Entra ID
6257

6358
1. Include the libraries in your code
64-
65-
```
59+
60+
```csharp
6661
using Azure.Identity;
6762
using StackExchange.Redis
6863
```
6964

7065
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.
71-
66+
7267
```csharp
7368
var configurationOptions = await ConfigurationOptions.Parse($"{_redisHostName}").ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
7469
ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
7570
IDatabase Database = _newConnection.GetDatabase();
7671
```
7772

78-
### To edit the *appsettings.json* file
73+
### To edit the _appsettings.json_ file
7974

80-
1. Edit the *Web.config* file. Then add the following content:
75+
1. Edit the _Web.config_ file. Then add the following content:
8176

8277
```json
8378
"_redisHostName":"<cache-hostname>"
8479
```
8580

86-
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal. For example, *my-redis.eastus.azure.net:10000*
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_.
8782

8883
1. Save the file.
8984

9085
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).
9186

92-
9387
## Run the sample
9488

95-
If you have opened any files, save them and build the app with the following command:
89+
If you opened any files, save them, and build the app with the following command:
9690

9791
```dos
9892
dotnet build
9993
```
10094

101-
Run the app with the following command to test serialization of .NET objects:
95+
To test serialization of .NET objects, run the app with the following command:
10296

10397
```dos
10498
dotnet run

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Clone the repo from [Azure-Samples/azure-cache-redis-samples](https://github.com
2222

2323
- Azure subscription - [create one for free](https://azure.microsoft.com/free/)
2424
- [Visual Studio 2019](https://www.visualstudio.com/downloads/)
25-
- [.NET Framework 4 or higher](https://dotnet.microsoft.com/download/dotnet-framework), which is required by the StackExchange.Redis client.
25+
- [.NET Framework 4 or higher](https://dotnet.microsoft.com/download/dotnet-framework) is required by the StackExchange.Redis client.
2626

2727
::: zone pivot="azure-managed-redis"
2828

@@ -50,16 +50,17 @@ Clone the repo from [Azure-Samples/azure-cache-redis-samples](https://github.com
5050

5151
<!-- [!INCLUDE [redis-cache-passwordless](includes/redis-cache-passwordless.md)] -->
5252

53-
### Install the Library for using Entra ID Authentication
54-
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 Entra ID. It is applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
53+
### Install the Library for using Microsoft Entra ID Authentication
54+
55+
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).
5556

5657
```cli
5758
dotnet add package Microsoft.Azure.StackExchangeRedis
5859
```
5960

6061
----
6162

62-
### Connect to the cache using Entra ID
63+
### Connect to the cache using Microsoft Entra ID
6364

6465
1. Include the libraries in your code
6566

@@ -88,7 +89,7 @@ IDatabase Database = _newConnection.GetDatabase();
8889
</appSettings>
8990
```
9091

91-
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal. For example, *my-redis.eastus.azure.net:10000*
92+
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:10000*
9293

9394
1. Save the file.
9495

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

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,75 +55,77 @@ azd up
5555

5656
[!INCLUDE [cache-entra-access](includes/cache-entra-access.md)]
5757

58-
<!-- ## [Access Key Authentication](#tab/accesskey) -->
58+
### Install the Library for using Microsoft Entra ID Authentication
5959

60-
[!INCLUDE [redis-access-key-alert](includes/redis-access-key-alert.md)]
61-
62-
<!-- [!INCLUDE [redis-cache-passwordless](includes/redis-cache-passwordless.md)] -->
63-
64-
### Install the Library for using Entra ID Authentication
65-
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 Entra ID. It is applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
60+
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 is applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
6661

6762
```cli
6863
dotnet add package Microsoft.Azure.StackExchangeRedis
6964
```
7065

71-
---
72-
73-
## Connect to the cache using Entra ID
66+
## Connect to the cache using Microsoft Entra ID
7467

7568
1. Include the libraries in your code
76-
77-
```
78-
using Azure.Identity;
79-
using StackExchange.Redis
80-
```
69+
70+
```csharp
71+
using Azure.Identity;
72+
using StackExchange.Redis
73+
```
8174

8275
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.
83-
84-
```csharp
85-
var configurationOptions = await ConfigurationOptions.Parse($"{_redisHostName}").ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
86-
ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
87-
IDatabase Database = _newConnection.GetDatabase();
88-
```
8976

90-
### To edit the *appsettings.json* file
77+
```csharp
78+
var configurationOptions = await ConfigurationOptions.Parse($"{_redisHostName}").ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
79+
ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
80+
IDatabase Database = _newConnection.GetDatabase();
81+
```
82+
83+
### To edit the _appsettings.json_ file
9184

92-
1. Edit the *Web.config* file. Then add the following content:
85+
1. Edit the _Web.config_ file. Then add the following content:
9386

9487
```json
9588
"_redisHostName":"<cache-hostname>"
9689
```
9790

98-
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal. For example, *my-redis.eastus.azure.net:10000*
91+
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal.
9992

100-
1. Save the file.
93+
::: zone pivot="azure-managed-redis"
10194

102-
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).
95+
For example, with Azure Managed Redis or the Enterprise tiers: _my-redis.eastus.azure.net:10000_
96+
97+
::: zone-end
98+
99+
::: zone pivot="azure-cache-redis"
100+
101+
For example, with Azure Cache for Redis: _my-redis.eastus.azure.net:6380_
103102

103+
::: zone-end
104+
105+
1. Save the file.
104106

107+
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).
105108
106109
## Run the app locally
107110

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

110-
```dos
111-
dotnet build
112-
```
113+
```dos
114+
dotnet build
115+
```
113116

114117
1. Then run the app with the following command:
115118

116-
```dos
117-
dotnet run
118-
```
119+
```dos
120+
dotnet run
121+
```
119122

120123
1. Browse to `https://localhost:5001` in your web browser.
121124
122125
1. Select **Azure Cache for Redis Test** in the navigation bar of the web page to test cache access.
123126

124-
:::image type="content" source="./media/cache-web-app-aspnet-core-howto/cache-simple-test-complete-local.png" alt-text="Screenshot of simple test completed locally.":::
127+
:::image type="content" source="./media/cache-web-app-aspnet-core-howto/cache-simple-test-complete-local.png" alt-text="Screenshot of simple test completed locally.":::
125128

126-
<!-- Clean up include -->
127129
[!INCLUDE [cache-delete-resource-group](includes/cache-delete-resource-group.md)]
128130

129131
## Related content

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

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,25 @@ Clone the repo [https://github.com/Azure-Samples/azure-cache-redis-samples/tree/
4242

4343
[!INCLUDE [cache-entra-access](includes/cache-entra-access.md)]
4444

45-
[!INCLUDE [redis-access-key-alert](includes/redis-access-key-alert.md)]
45+
### Install the library for using Microsoft Entra ID Authentication
4646

47-
<!--
48-
[!INCLUDE [redis-cache-passwordless](includes/redis-cache-passwordless.md)]
49-
-->
50-
### Install the Library for using Entra ID Authentication
51-
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 Entra ID. It is applicable to all Azure Cache for Redis, Azure Cache for Redis Enterprise, and Azure Managed Redis (Preview).
47+
The [Azure.StackExchange.Redis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) library contains the Microsoft using 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).
5248

5349
```cli
5450
dotnet add package Microsoft.Azure.StackExchangeRedis
5551
```
5652

57-
### Connect to the cache using Entra ID
53+
### Connect to the cache using Microsoft Entra ID
5854

5955
1. Include the libraries in your code
60-
56+
6157
```
6258
using Azure.Identity;
6359
using StackExchange.Redis
6460
```
6561

6662
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.
67-
63+
6864
```csharp
6965
var configurationOptions = await ConfigurationOptions.Parse($"{_redisHostName}").ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
7066
ConnectionMultiplexer _newConnection = await ConnectionMultiplexer.ConnectAsync(configurationOptions);
@@ -73,7 +69,7 @@ IDatabase Database = _newConnection.GetDatabase();
7369

7470
### To edit the *CacheSecrets.config* file
7571

76-
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*.
72+
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_.
7773

7874
1. Edit the *Web.config* file. Then add the following content:
7975

@@ -83,14 +79,12 @@ IDatabase Database = _newConnection.GetDatabase();
8379
</appSettings>
8480
```
8581

86-
1. Replace `<cache-hostname>` with your cache host name as it appears in the Overview blade of Azure Portal. For example, *my-redis.eastus.azure.net:10000*
82+
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*
8783

8884
1. Save the file.
8985

9086
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).
9187

92-
<!-- :::code language="csharp" source="~/samples-cache/quickstart/aspnet/ContosoTeamStats/RedisConnection.cs "::: -->
93-
9488
## Run the app locally
9589

9690
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.
@@ -123,7 +117,7 @@ After you successfully test the app locally, you can deploy the app to Azure and
123117

124118
| Setting | Recommended value | Description |
125119
| ------- | :---------------: | ----------- |
126-
| **App name** | Use the default. | The app name is the host name for the app when it's deployed to Azure. The name might have a timestamp suffix added to it to make it unique if necessary. |
120+
| **App name** | Use the default. | The app name is the host name for the app when deployed to Azure. The name might have a timestamp suffix added to it to make it unique if necessary. |
127121
| **Subscription** | Choose your Azure subscription. | This subscription is charged for any related hosting costs. If you have multiple Azure subscriptions, verify that the subscription that you want is selected.|
128122
| **Resource group** | Use the same resource group where you created the cache (for example, *TestResourceGroup*). | The resource group helps you manage all resources as a group. Later, when you want to delete the app, you can just delete the group. |
129123
| **App Service plan** | Select **New**, and then create a new App Service plan named *TestingPlan*. <br />Use the same **Location** you used when creating your cache. <br />Choose **Free** for the size. | An App Service plan defines a set of compute resources for a web app to run with. |
@@ -132,25 +126,25 @@ After you successfully test the app locally, you can deploy the app to Azure and
132126

133127
1. After you configure the App Service hosting settings, select **Create**.
134128

135-
1. Monitor the **Output** window in Visual Studio to see the publishing status. After the app has been published, the URL for the app is logged:
129+
1. Monitor the **Output** window in Visual Studio to see the publishing status. After the app is published, the URL for the app is logged:
136130

137131
:::image type="content" source="media/cache-web-app-howto/cache-publishing-output.png" alt-text="Screenshot publishing information in the output pane.":::
138132

139133
### Add the app setting for the cache
140134

141-
After the new app has been published, add a new app setting. This setting is used to store the cache connection information.
135+
After the new app is published, add a new app setting. This setting is used to store the cache connection information.
142136

143137
#### To add the app setting
144138

145-
1. Type the app name in the search bar at the top of the Azure portal to find the new app you created.
139+
1. To find the new app you created, type the app name in the search bar at the top of the Azure portal.
146140

147141
:::image type="content" source="media/cache-web-app-howto/cache-find-app-service.png" alt-text="Screenshot showing how to find the app on the Azure portal.":::
148142

149143
2. Add a new app setting named **CacheConnection** for the app to use to connect to the cache. Use the same value you configured for `RedisHostName` in your *web.config* file.
150144

151145
### Run the app in Azure
152146

153-
1. In your browser, go to the URL for the app. The URL appears in the results of the publishing operation in the Visual Studio output window. It's also provided in the Azure portal on the overview page of the app you created.
147+
1. In your browser, go to the URL for the app. The URL appears in the results of the publishing operation in the Visual Studio output window. The URL is also provided in the Azure portal on the overview page of the app you created.
154148

155149
1. Select **Azure Cache for Redis Test** on the navigation bar to test cache access as you did with the local version.
156150

0 commit comments

Comments
 (0)