Skip to content

Commit adc8b6f

Browse files
committed
Tabs look good; adding new content for publish.
1 parent 2832ef4 commit adc8b6f

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

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

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,16 @@ Open the *.csproj* file. Add a `UserSecretsId` element as shown here. You can us
7979
```
8080
#### [.NET Core 3.x](#tab/core3x)
8181

82-
This includes a bunch of neat stuff for 3x
82+
```xml
83+
<Project Sdk="Microsoft.NET.Sdk.Web">
84+
85+
<PropertyGroup>
86+
<TargetFramework>netcoreapp3.1</TargetFramework>
87+
<UserSecretsId>79a3edd0-2092-40a2-a04d-dcb46d5ca9ed</UserSecretsId>
88+
</PropertyGroup>
8389

90+
</Project>
91+
```
8492
---
8593

8694
The Secret Manager tool stores sensitive data for development work outside of your project tree. This approach helps prevent the accidental sharing of app secrets within source code. For more information on Secret Manager, please see [Safe storage of app secrets in development in ASP.NET Core](https://docs.microsoft.com/aspnet/core/security/app-secrets)
@@ -89,22 +97,22 @@ The Secret Manager tool stores sensitive data for development work outside of yo
8997

9098
9. Add a reference to the `Microsoft.Azure.AppConfiguration.AspNetCore` NuGet package by running the following command:
9199

92-
```CLI
93-
dotnet add package Microsoft.Azure.AppConfiguration.AspNetCore --version 2.0.0-preview-010060003-1250
100+
```dotnetcli
101+
dotnet add package Microsoft.Azure.AppConfiguration.AspNetCore --version 3.0.0-preview-010560002-1165
94102
```
95103
10. Run the following command to restore packages for your project:
96104
97-
```CLI
98-
dotnet restore
105+
```dotnetcli
106+
dotnet restore
99107
```
100108
11. Add a secret named *ConnectionStrings:AppConfig* to Secret Manager.
101109
102110
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.
103111
104112
This command must be executed in the same directory as the *.csproj* file.
105113
106-
```CLI
107-
dotnet user-secrets set ConnectionStrings:AppConfig <your_connection_string>
114+
```dotnetcli
115+
dotnet user-secrets set ConnectionStrings:AppConfig <your_connection_string>
108116
```
109117
110118
> [!IMPORTANT]
@@ -125,7 +133,7 @@ The Secret Manager tool stores sensitive data for development work outside of yo
125133
> [!IMPORTANT]
126134
> `CreateHostBuilder` replaces `CreateWebHostBuilder` in .NET Core 3.0. Select the correct syntax based on your environment.
127135
128-
### Update `CreateWebHostBuilder` for .NET Core 2.x
136+
#### [.NET Core 2.x](#tab/core2x)
129137
130138
```csharp
131139
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
@@ -138,8 +146,8 @@ The Secret Manager tool stores sensitive data for development work outside of yo
138146
.UseStartup<Startup>();
139147
```
140148
141-
### Update `CreateHostBuilder` for .NET Core 3.x
142-
149+
#### [.NET Core 3.x](#tab/core3x)
150+
143151
```csharp
144152
public static IHostBuilder CreateHostBuilder(string[] args) =>
145153
Host.CreateDefaultBuilder(args)
@@ -151,8 +159,9 @@ The Secret Manager tool stores sensitive data for development work outside of yo
151159
})
152160
.UseStartup<Startup>());
153161
```
162+
---
154163
155-
1. Navigate to *<app root>/Views/Home* and open *Index.cshtml*. Replace its content with the following code:
164+
14. Navigate to *<app root>/Views/Home* and open *Index.cshtml*. Replace its content with the following code:
156165
157166
```HTML
158167
@using Microsoft.Extensions.Configuration
@@ -171,7 +180,7 @@ The Secret Manager tool stores sensitive data for development work outside of yo
171180
<h1>@Configuration["TestApp:Settings:Message"]</h1>
172181
```
173182
174-
14. Navigate to *<app root>/Views/Shared* and open *_Layout.cshtml*. Replace its content with the following code:
183+
15. Navigate to *<app root>/Views/Shared* and open *_Layout.cshtml*. Replace its content with the following code:
175184
176185
```HTML
177186
<!DOCTYPE html>
@@ -200,19 +209,19 @@ The Secret Manager tool stores sensitive data for development work outside of yo
200209
201210
## Build and run the app locally
202211
203-
15. 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:
212+
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:
204213
205-
```CLI
206-
dotnet build
214+
```dotnetcli
215+
dotnet build
207216
```
208217
209-
16. After the build successfully completes, run the following command to run the web app locally:
218+
17. After the build successfully completes, run the following command to run the web app locally:
210219
211-
```CLI
212-
dotnet run
220+
```dotnetcli
221+
dotnet run
213222
```
214223
215-
17. 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.
224+
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.
216225
217226
If you're working in the Azure Cloud Shell, select the *Web Preview* button followed by *Configure*.
218227

0 commit comments

Comments
 (0)