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
@@ -29,9 +29,12 @@ In this tutorial, you will start with a basic ASP.NET Core Web App and then add
29
29
30
30
1. Create a new Azure Cache for Redis instance by using the Azure portal or your preferred CLI tool. Use the [quickstart guide](quickstart-create-redis.md) to get started.
31
31
32
+
For this tutorial, use a Standard C1 cache.
33
+
:::image type="content" source="media/cache-tutorial-aks-get-started/cache-new-instance.png" alt-text="Screenshot of creating a Standard C1 cache in the Azure portal":::
34
+
32
35
1. On the **Advanced** tab, enable Microsoft Entra Authentication.
33
36
34
-
1. Follow the steps through to create the cache. Alternately, you can run the following steps on an existing cache with Microsoft Entra Authentication enabled.
37
+
1. Follow the steps through to create the cache.
35
38
36
39
1. Once your cache is created, go to the **Data Access Configuration** and click on Add > New Redis User.
37
40
@@ -51,18 +54,9 @@ Follow the steps described in the [Azure App Service tutorial](https://learn.mic
51
54
52
55
1. Open your web application in Visual Studio and right click on the project. Click on the Manage NuGet Packages. Browse and install the latest version of Microsoft.Azure.StackExchangeRedis.
53
56
54
-
1. Open the Views/Home/Index.cshtml file and replace with the following code to a button which will write data to your Azure Cache for Redis instance
57
+
1. Open the Index.cshtml file and append the following code to a button which will write data to your Azure Cache for Redis instance
55
58
56
59
```html
57
-
@{
58
-
ViewData["Title"] = "Home Page";
59
-
}
60
-
61
-
<divclass="text-center">
62
-
<h1class="display-4">Welcome</h1>
63
-
<p>Learn about <ahref="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
1. Open the Program.cs file and replace with the following code snippet which will instantiate a connection to your Azure Cache for Redis Instance using system assigned managed identity
89
+
1. Open the Program.cs file and the following code snippet to instantiate a connection to your Azure Cache for Redis Instance.
138
90
Note that
139
91
- redisHostName is the hostname for the Azure Cache for Redis instance that you created earlier
140
-
-msiPrincipalID is the Principal Id for your Azure App Service system assigned managed identity.
92
+
-webAppObjectId is the object (Principal) Id for your Azure App Service system assigned managed identity.
1. Right click on your project and choose Publish. Follow instructions to publish the updated web app to the Azure App Service that you created earlier.
109
+
## Clean up your deployment
189
110
190
-
1. After publishing your web app successfully to Azure App Service, a browser window will open which loads your custom controller along with "Update timestamp" button.
191
-
Click the button and see the latest timestamp when data in your Redis instance is updated.
111
+
To clean up your cluster, run the following commands:
192
112
193
-
## Clean up resources
194
-
195
-
In the preceding steps, you created Azure resources in a resource group. If you don't expect to need these resources in the future, you can delete them by deleting the resource group.
196
-
197
-
From your web app's Overview page in the Azure portal, select the myResourceGroup link under Resource group.
198
-
On the resource group page, make sure that the listed resources are the ones you want to delete.
199
-
Select Delete, type myResourceGroup in the text box, and then select Delete.
0 commit comments