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
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-aspnet-core-app.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,9 @@ In this quickstart, you will use Azure App Configuration to centralize storage a
43
43
44
44
Use the [.NET Core command-line interface (CLI)](https://docs.microsoft.com/dotnet/core/tools/) to create a new ASP.NET Core MVC web app project. The [Azure Cloud Shell](https://shell.azure.com) provides these tools for you. They are also available across the Windows, macOS, and Linux platforms.
45
45
46
-
7. Create a new folder for your project. For this quickstart, name it *TestAppConfig*.
46
+
1. Create a new folder for your project. For this quickstart, name it *TestAppConfig*.
47
47
48
-
8. In the new folder, run the following command to create a new ASP.NET Core MVC web app project:
48
+
1. In the new folder, run the following command to create a new ASP.NET Core MVC web app project:
49
49
50
50
```dotnetcli
51
51
dotnet new mvc --no-https
@@ -96,17 +96,17 @@ The Secret Manager tool stores sensitive data for development work outside of yo
96
96
97
97
## Connect to an App Configuration store
98
98
99
-
9. Add a reference to the `Microsoft.Azure.AppConfiguration.AspNetCore` NuGet package by running the following command:
99
+
1. Add a reference to the `Microsoft.Azure.AppConfiguration.AspNetCore` NuGet package by running the following command:
10. Run the following command to restore packages for your project:
104
+
1. Run the following command to restore packages for your project:
105
105
106
106
```dotnetcli
107
107
dotnet restore
108
108
```
109
-
11. Add a secret named *ConnectionStrings:AppConfig* to Secret Manager.
109
+
1. Add a secret named *ConnectionStrings:AppConfig* to Secret Manager.
110
110
111
111
This secret contains the connection string to access your App Configuration store. Replace the value in the following command with the connection string for your App Configuration store.
112
112
@@ -123,13 +123,13 @@ The Secret Manager tool stores sensitive data for development work outside of yo
123
123
124
124
Access this secret using the configuration API. A colon (:) works in the configuration name with the configuration API on all supported platforms. See [Configuration by environment](https://docs.microsoft.com/aspnet/core/fundamentals/configuration/index?tabs=basicconfiguration&view=aspnetcore-2.0).
125
125
126
-
12. Open *Program.cs*, and add a reference to the .NET Core App Configuration provider.
126
+
1. Open *Program.cs*, and add a reference to the .NET Core App Configuration provider.
127
127
128
128
```csharp
129
129
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
130
130
```
131
131
132
-
13. Update the `CreateWebHostBuilder` method to use App Configuration by calling the `config.AddAzureAppConfiguration()` method.
132
+
1. Update the `CreateWebHostBuilder` method to use App Configuration by calling the `config.AddAzureAppConfiguration()` method.
133
133
134
134
> [!IMPORTANT]
135
135
> `CreateHostBuilder` replaces `CreateWebHostBuilder` in .NET Core 3.0. Select the correct syntax based on your environment.
@@ -162,7 +162,7 @@ The Secret Manager tool stores sensitive data for development work outside of yo
162
162
```
163
163
---
164
164
165
-
14. Navigate to *<app root>/Views/Home* and open *Index.cshtml*. Replace its content with the following code:
165
+
1. Navigate to *<app root>/Views/Home* and open *Index.cshtml*. Replace its content with the following code:
166
166
167
167
```HTML
168
168
@using Microsoft.Extensions.Configuration
@@ -181,7 +181,7 @@ The Secret Manager tool stores sensitive data for development work outside of yo
15. Navigate to *<app root>/Views/Shared* and open *_Layout.cshtml*. Replace its content with the following code:
184
+
1. Navigate to *<app root>/Views/Shared* and open *_Layout.cshtml*. Replace its content with the following code:
185
185
186
186
```HTML
187
187
<!DOCTYPE html>
@@ -210,19 +210,19 @@ The Secret Manager tool stores sensitive data for development work outside of yo
210
210
211
211
## Build and run the app locally
212
212
213
-
16. To build the app using the .NET Core CLI, navigate to the root directory of your application and run the following command in the command shell:
213
+
1. To build the app using the .NET Core CLI, navigate to the root directory of your application and run the following command in the command shell:
214
214
215
215
```dotnetcli
216
216
dotnet build
217
217
```
218
218
219
-
17. After the build successfully completes, run the following command to run the web app locally:
219
+
1. After the build successfully completes, run the following command to run the web app locally:
220
220
221
221
```dotnetcli
222
222
dotnet run
223
223
```
224
224
225
-
18. If you're working on your local machine, use a browser to navigate to `http://localhost:5000`. This is the default URL for the web app hosted locally.
225
+
1. If you're working on your local machine, use a browser to navigate to `http://localhost:5000`. This is the default URL for the web app hosted locally.
226
226
227
227
If you're working in the Azure Cloud Shell, select the *Web Preview* button followed by *Configure*.
0 commit comments