Skip to content

Commit edde5a7

Browse files
committed
Apply fixes from review
1 parent f3aede3 commit edde5a7

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

articles/azure-app-configuration/quickstart-aspnet-core-app.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: azure-app-configuration
77
ms.devlang: csharp
88
ms.custom: devx-track-csharp, contperf-fy21q1, mode-other, engagement-fy23
99
ms.topic: quickstart
10-
ms.date: 12/16/2022
10+
ms.date: 01/04/2023
1111
ms.author: zhenlwa
1212
#Customer intent: As an ASP.NET Core developer, I want to learn how to manage all my app settings in one place.
1313
---
@@ -78,16 +78,14 @@ dotnet new webapp --output TestAppConfig --framework netcoreapp3.1
7878
7979
Secret Manager stores the secret outside of your project tree, which helps prevent the accidental sharing of secrets within source code. It's used only to test the web app locally. When the app is deployed to Azure like [App Service](../app-service/overview.md), use the *Connection strings*, *Application settings* or environment variables to store the connection string. Alternatively, to avoid connection strings all together, you can [connect to App Configuration using managed identities](./howto-integrate-azure-managed-service-identity.md) or your other [Azure AD identities](./concept-enable-rbac.md).
8080
81-
1. Open *Program.cs*, add the `using TestAppConfig;` statement and add Azure App Configuration as an extra configuration source by calling the `AddAzureAppConfiguration` method.
81+
1. Open *Program.cs* and add Azure App Configuration as an extra configuration source by calling the `AddAzureAppConfiguration` method.
8282
8383
#### [.NET 6.x](#tab/core6x)
8484
8585
```csharp
8686
// Existing code in Program.cs
8787
// ... ...
8888
89-
using TestAppConfig;
90-
9189
var builder = WebApplication.CreateBuilder(args);
9290
9391
// Retrieve the connection string
@@ -150,9 +148,11 @@ In this example, you'll update a web page to display its content using the setti
150148
151149
#### [.NET 6.x](#tab/core6x)
152150
153-
Update *Program.cs* with the following code.
151+
Update *Program.cs* with the following code and add the `TestAppConfig` namespace at the beginning of the file.
154152
155153
```csharp
154+
using TestAppConfig;
155+
156156
// Existing code in Program.cs
157157
// ... ...
158158
@@ -183,25 +183,26 @@ In this example, you'll update a web page to display its content using the setti
183183
184184
---
185185
186-
1. Open *Index.cshtml.cs* in the *Pages* directory. Add the [Microsoft.Extensions.Options](/dotnet/api/microsoft.extensions.options) namespace and update the `IndexModel` class with the following code.
186+
1. Open *Index.cshtml.cs* in the *Pages* directory and update it with the following code.
187187
188188
```csharp
189-
// Existing code in Index.cshtml.cs
190-
// ... ...
191-
189+
using Microsoft.AspNetCore.Mvc.RazorPages;
192190
using Microsoft.Extensions.Options;
193191
194-
public class IndexModel : PageModel
192+
namespace TestAppConfig.Pages
195193
{
196-
private readonly ILogger<IndexModel> _logger;
197-
198-
public Settings Settings { get; }
199-
200-
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
201-
{
202-
Settings = options.Value;
203-
_logger = logger;
204-
}
194+
public class IndexModel : PageModel
195+
{
196+
private readonly ILogger<IndexModel> _logger;
197+
198+
public Settings Settings { get; }
199+
200+
public IndexModel(IOptionsSnapshot<Settings> options, ILogger<IndexModel> logger)
201+
{
202+
Settings = options. Value;
203+
_logger = logger;
204+
}
205+
}
205206
}
206207
```
207208
@@ -249,7 +250,7 @@ In this example, you'll update a web page to display its content using the setti
249250
:::image type="content" source="./media/quickstarts/cloud-shell-web-preview.png" alt-text="Screenshot of Azure Cloud Shell. Locate Web Preview.":::
250251
251252
The web page looks like this:
252-
:::image type="content" source="./media/quickstarts/aspnet-core-app-launch-local-navbar.png" alt-text="Screenshot of the browser.Launching quickstart app locally.":::
253+
:::image type="content" source="./media/quickstarts/aspnet-core-app-launch-local-navbar.png" alt-text="Screenshot of the browser.Launching quickstart app locally.":::
253254
254255
## Clean up resources
255256

0 commit comments

Comments
 (0)