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
Create a new folder named _MyFirstAzureWebApp_, and open it in Visual Studio Code. Open the <ahref="https://code.visualstudio.com/docs/editor/integrated-terminal"target="_blank">Terminal</a> window, and create a new .NET web app using the [`dotnet new webapp`](/dotnet/core/tools/dotnet-new#web-options) command.
196
-
197
-
### [.NET 6.0](#tab/net60)
198
-
199
-
```dotnetcli
200
-
dotnet new webapp -f net6.0
201
-
```
202
-
203
-
### [.NET Framework 4.8](#tab/netframework48)
204
-
205
-
```dotnetcli
206
-
dotnet new webapp --target-framework-override net48
207
-
```
208
-
209
-
> [!IMPORTANT]
210
-
> The `--target-framework-override` flag is a free-form text replacement of the target framework moniker (TFM) for the project, and makes *no guarantees* that the supporting template exists or compiles. You can only build and run .NET Framework apps on Windows.
211
-
212
-
---
213
-
214
-
From the **Terminal** in Visual Studio Code, run the application locally using the [`dotnet run`](/dotnet/core/tools/dotnet-run) command.
215
-
216
-
```dotnetcli
217
-
dotnet run
218
-
```
219
-
220
-
Open a web browser, and navigate to the app at `https://localhost:5001`.
195
+
1. In the terminal window, create a new folder named _MyFirstAzureWebApp_, and open it in Visual Studio Code.
221
196
197
+
```terminal
198
+
mkdir MyFirstAzureWebApp
199
+
code MyFirstAzureWebApp
200
+
```
222
201
223
-
### [.NET 6.0](#tab/net60)
202
+
1. In Visual Studio Code, open the <a href="https://code.visualstudio.com/docs/editor/integrated-terminal" target="_blank">Terminal</a> window by typing `Ctrl` + `` ` ``.
224
203
225
-
You'll see the template ASP.NET Core 6.0 web app displayed in the page.
204
+
1. In the terminal in Visual Studio Code, create a new .NET web app using the [`dotnet new webapp`](/dotnet/core/tools/dotnet-new#web-options) command.
226
205
227
-
:::image type="content" source="media/quickstart-dotnet/local-webapp-net.png" alt-text="Visual Studio Code - run .NET 6.0 in browser locally." lightbox="media/quickstart-dotnet/local-webapp-net.png" border="true":::
206
+
### [.NET 6.0](#tab/net60)
207
+
208
+
```dotnetcli
209
+
dotnet new webapp -f net6.0
210
+
```
211
+
212
+
### [.NET Framework 4.8](#tab/netframework48)
213
+
214
+
```dotnetcli
215
+
dotnet new webapp --target-framework-override net48
216
+
```
217
+
218
+
> [!IMPORTANT]
219
+
> The `--target-framework-override` flag is a free-form text replacement of the target framework moniker (TFM) for the project, and makes *no guarantees* that the supporting template exists or compiles. You can only build and run .NET Framework apps on Windows.
220
+
221
+
---
228
222
229
-
### [.NET Framework 4.8](#tab/netframework48)
223
+
1. From the **Terminal** in Visual Studio Code, run the application locally using the [`dotnet run`](/dotnet/core/tools/dotnet-run) command.
230
224
231
-
You'll see the template ASP.NET Framework 4.8 web app displayed in the page.
225
+
```dotnetcli
226
+
dotnet run --urls=https://localhost:5001/
227
+
```
232
228
233
-
:::image type="content" source="media/quickstart-dotnet/local-webapp-net48.png" alt-text="Visual Studio Code - run .NET 4.8 in browser locally." lightbox="media/quickstart-dotnet/local-webapp-net48.png" border="true":::
229
+
1. Open a web browser, and navigate to the app at `https://localhost:5001`.
234
230
235
-
---
231
+
### [.NET 6.0](#tab/net60)
232
+
233
+
You'll see the template ASP.NET Core 6.0 web app displayed in the page.
234
+
235
+
:::image type="content" source="media/quickstart-dotnet/local-webapp-net.png" alt-text="Visual Studio Code - run .NET 6.0 in browser locally." lightbox="media/quickstart-dotnet/local-webapp-net.png" border="true":::
236
+
237
+
### [.NET Framework 4.8](#tab/netframework48)
238
+
239
+
You'll see the template ASP.NET Framework 4.8 web app displayed in the page.
240
+
241
+
:::image type="content" source="media/quickstart-dotnet/local-webapp-net48.png" alt-text="Visual Studio Code - run .NET 4.8 in browser locally." lightbox="media/quickstart-dotnet/local-webapp-net48.png" border="true":::
Open a terminal window on your machine to a working directory. Create a new .NET web app using the [`dotnet new webapp`](/dotnet/core/tools/dotnet-new#web-options) command, and then change directories into the newly created app.
244
-
245
-
<!-- Please keep the following commands in two lines instead of one && separated line. The latter doesn't work in PowerShell -->
246
-
247
-
### [.NET 6.0](#tab/net60)
248
-
249
-
```dotnetcli
250
-
dotnet new webapp -n MyFirstAzureWebApp --framework net6.0
251
-
cd MyFirstAzureWebApp
252
-
```
253
-
254
-
### [.NET Framework 4.8](#tab/netframework48)
255
-
256
-
```dotnetcli
257
-
dotnet new webapp -n MyFirstAzureWebApp --target-framework-override net48
258
-
cd MyFirstAzureWebApp
259
-
```
260
-
261
-
> [!IMPORTANT]
262
-
> The `--target-framework-override` flag is a free-form text replacement of the target framework moniker (TFM) for the project, and makes *no guarantees* that the supporting template exists or compiles. You can only build .NET Framework apps on Windows.
263
-
264
-
---
265
-
266
-
From the same terminal session, run the application locally using the [`dotnet run`](/dotnet/core/tools/dotnet-run) command.
267
-
268
-
```dotnetcli
269
-
dotnet run
270
-
```
251
+
1. Open a terminal window on your machine to a working directory. Create a new .NET web app using the [`dotnet new webapp`](/dotnet/core/tools/dotnet-new#web-options) command, and then change directories into the newly created app.
271
252
272
-
Open a web browser, and navigate to the app at `https://localhost:5001`.
273
-
274
-
### [.NET 6.0](#tab/net60)
275
-
276
-
You'll see the template ASP.NET Core 6.0 web app displayed in the page.
277
-
278
-
:::image type="content" source="media/quickstart-dotnet/local-webapp-net.png" alt-text="Visual Studio Code - ASP.NET Core 6.0 in local browser." lightbox="media/quickstart-dotnet/local-webapp-net.png" border="true":::
253
+
<!-- Please keep the following commands in two lines instead of one && separated line. The latter doesn't work in PowerShell -->
254
+
255
+
### [.NET 6.0](#tab/net60)
256
+
257
+
```dotnetcli
258
+
dotnet new webapp -n MyFirstAzureWebApp --framework net6.0
259
+
cd MyFirstAzureWebApp
260
+
```
261
+
262
+
### [.NET Framework 4.8](#tab/netframework48)
263
+
264
+
```dotnetcli
265
+
dotnet new webapp -n MyFirstAzureWebApp --target-framework-override net48
266
+
cd MyFirstAzureWebApp
267
+
```
268
+
269
+
> [!IMPORTANT]
270
+
> The `--target-framework-override` flag is a free-form text replacement of the target framework moniker (TFM) for the project, and makes *no guarantees* that the supporting template exists or compiles. You can only build .NET Framework apps on Windows.
271
+
272
+
---
279
273
280
-
### [.NET Framework 4.8](#tab/netframework48)
274
+
1. From the same terminal session, run the application locally using the [`dotnet run`](/dotnet/core/tools/dotnet-run) command.
281
275
282
-
You'll see the template ASP.NET Framework 4.8 web app displayed in the page.
276
+
```dotnetcli
277
+
dotnet run --urls=https://localhost:5001/
278
+
```
283
279
284
-
:::image type="content" source="media/quickstart-dotnet/local-webapp-net48.png" alt-text="Visual Studio Code - ASP.NET Framework 4.8 in local browser." lightbox="media/quickstart-dotnet/local-webapp-net48.png" border="true":::
280
+
1. Open a web browser, and navigate to the app at `https://localhost:5001`.
285
281
286
-
---
282
+
### [.NET 6.0](#tab/net60)
283
+
284
+
You'll see the template ASP.NET Core 6.0 web app displayed in the page.
285
+
286
+
:::image type="content" source="media/quickstart-dotnet/local-webapp-net.png" alt-text="Visual Studio Code - ASP.NET Core 6.0 in local browser." lightbox="media/quickstart-dotnet/local-webapp-net.png" border="true":::
287
+
288
+
### [.NET Framework 4.8](#tab/netframework48)
289
+
290
+
You'll see the template ASP.NET Framework 4.8 web app displayed in the page.
291
+
292
+
:::image type="content" source="media/quickstart-dotnet/local-webapp-net48.png" alt-text="Visual Studio Code - ASP.NET Framework 4.8 in local browser." lightbox="media/quickstart-dotnet/local-webapp-net48.png" border="true":::
293
+
294
+
---
287
295
288
296
:::zone-end
289
297
@@ -296,7 +304,7 @@ As part of setting up the App Service, you'll create:
296
304
- A new [resource group](../azure-resource-manager/management/overview.md#terminology) to contain all of the Azure resources for the service.
297
305
- A new [Hosting Plan](overview-hosting-plans.md) that specifies the location, size, and features of the web server farm that hosts your app.
298
306
299
-
Follow these steps to create your App Service and publish your web app:
307
+
Follow these steps to create your App Service resources and publish your project:
Once the wizard completes, the Azure resources are created for you and you are ready to publish.
347
+
Once the wizard completes, the Azure resources are created for you and you are ready to publish your ASP.NET Core project.
340
348
341
349
1. In the **Publish** dialog, make sure your new App Service app is selected in **App Service instance**, then select **Finish**. Visual Studio creates a publish profile for you for the selected App Service app.
342
350
1. In the **Publish** page, select **Publish**. If you see a warning message, click **Continue**.
@@ -361,31 +369,29 @@ Follow these steps to create your App Service and publish your web app:
To deploy your web app using the Visual Studio Azure Tools extension:
372
+
<!-- :::image type="content" source="media/quickstart-dotnet/vscode-sign-in-to-Azure.png" alt-text="Visual Studio Code - Sign in to Azure." border="true"::: -->
365
373
366
374
1. In Visual Studio Code, open the [**Command Palette**](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
367
375
1. Search for and select "Azure App Service: Deploy to Web App".
368
376
1. Respond to the prompts as follows:
369
377
370
-
- Select *MyFirstAzureWebApp* as the folder to deploy.
371
-
- Select **Add Config** when prompted.
372
-
- If prompted, sign in to your existing Azure account.
373
-
374
-
:::image type="content" source="media/quickstart-dotnet/vscode-sign-in-to-Azure.png" alt-text="Visual Studio Code - Sign in to Azure." border="true":::
375
-
376
-
- Select your **Subscription**.
377
-
- Select **Create new Web App... Advanced**.
378
-
- For **Enter a globally unique name**, use a name that's unique across all of Azure (*valid characters are `a-z`, `0-9`, and `-`*). A good pattern is to use a combination of your company name and an app identifier.
379
-
- Select **Create new resource group** and provide a name like `myResourceGroup`.
380
-
- When prompted to **Select a runtime stack**:
381
-
- For *.NET 6.0*, select **.NET 5**
378
+
1. Select *MyFirstAzureWebApp* as the folder to deploy.
379
+
1. Select **Add Config** when prompted.
380
+
1. If prompted, sign in to your Azure account.
381
+
1. Select your **Subscription**.
382
+
1. Select **Create new Web App... Advanced**.
383
+
1. For **Enter a globally unique name**, use a name that's unique across all of Azure (*valid characters are `a-z`, `0-9`, and `-`*). A good pattern is to use a combination of your company name and an app identifier.
384
+
1. Select **Create new resource group** and provide a name like `myResourceGroup`.
385
+
1. When prompted to **Select a runtime stack**:
386
+
- For *.NET 6.0*, select **.NET 6**
382
387
- For *.NET Framework 4.8*, select **ASP.NET V4.8**
383
-
- Select an operating system (Windows or Linux).
388
+
1. Select an operating system (Windows or Linux).
384
389
- For *.NET Framework 4.8*, Windows will be selected implicitly.
385
-
- Select **Create a new App Service plan**, provide a name, and select the **F1 Free**[pricing tier][app-service-pricing-tier].
386
-
- Select **Skip for now** for the Application Insights resource.
387
-
- Select a location near you.
390
+
1. Select a location near you.
391
+
1. Select **Create a new App Service plan**, provide a name, and select the **F1 Free** [pricing tier][app-service-pricing-tier].
392
+
1. Select **Skip for now** for the Application Insights resource.
388
393
394
+
1. In the popup **Always deploy the workspace "MyFirstAzureWebApp" to \<app-name>"**, select **Yes**. This way, as long as you're in the same workspace, Visual Studio Code deploys to the same App Service app each time.
389
395
1. When publishing completes, select **Browse Website** in the notification and select **Open** when prompted.
390
396
391
397
### [.NET 6.0](#tab/net60)
@@ -599,9 +605,8 @@ Follow these steps to update and redeploy your web app:
599
605
600
606
Save your changes.
601
607
602
-
1. Open the Visual Studio Code **Side Bar**, select the **Azure** icon to expand its options.
603
-
1. Under the **APP SERVICE** node, expand your subscription and right-click on the **MyFirstAzureWebApp**.
604
-
1. Select the **Deploy to Web App...**.
608
+
1. In Visual Studio Code, open the [**Command Palette**](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
609
+
1. Search for and select "Azure App Service: Deploy to Web App". Remember that your told Visual Studio Code to remember the app to deploy your workspace to in an earlier step.
605
610
1. Select **Deploy** when prompted.
606
611
1. When publishing completes, select **Browse Website** in the notification and select **Open** when prompted.
0 commit comments