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/app-service/quickstart-dotnetcore.md
+54-22Lines changed: 54 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,9 @@ In this quickstart, you learn how to create and deploy your first ASP.NET web ap
40
40
41
41
Alternatively, you can deploy an ASP.NET web app as part of a [Windows or Linux container in App Service](quickstart-custom-container.md).
42
42
43
+
> [!TIP]
44
+
> Find GitHub Copilot tips in the Visual Studio, Visual Studio Code, and Azure portal steps.
45
+
43
46
This video shows you how to deploy an ASP.NET web app.
44
47
> [!VIDEO 31309745-82c2-4208-aed5-7ace0b7f7f4d]
45
48
@@ -53,15 +56,17 @@ The steps in the video are also described in the following sections.
53
56
54
57
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
55
58
- <ahref="https://www.visualstudio.com/downloads"target="_blank">Visual Studio 2022</a> with the **ASP.NET and web development** workload.
59
+
-**(Optional)** To try GitHub Copilot, a [GitHub Copilot account](https://docs.github.com/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor). A 30-day free trial is available.
56
60
57
61
### [.NET Framework 4.8](#tab/netframework48)
58
62
59
63
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
60
64
- <ahref="https://www.visualstudio.com/downloads"target="_blank">Visual Studio 2022</a> with the **ASP.NET and web development** workload (ensure the optional checkbox **.NET Framework project and item templates** is selected).
65
+
-**(Optional)** To try GitHub Copilot, a [GitHub Copilot account](https://docs.github.com/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor). A 30-day free trial is available.
61
66
62
67
-----
63
68
64
-
If you have already installed Visual Studio 2022:
69
+
If you already installed Visual Studio 2022:
65
70
66
71
1. Install the latest updates in Visual Studio by selecting **Help** > **Check for Updates**.
67
72
1. Add the workload by selecting **Tools** > **Get Tools and Features**.
@@ -74,6 +79,7 @@ If you have already installed Visual Studio 2022:
74
79
- <ahref="https://www.visualstudio.com/downloads"target="_blank">Visual Studio Code</a>.
75
80
- The <ahref="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack"target="_blank">Azure Tools</a> extension.
-**(Optional)** To try GitHub Copilot, a [GitHub Copilot account](https://docs.github.com/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor). A 30-day free trial is available.
77
83
78
84
:::zone-end
79
85
@@ -84,6 +90,7 @@ If you have already installed Visual Studio 2022:
84
90
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
85
91
- The <ahref="/cli/azure/install-azure-cli"target="_blank">Azure CLI</a>.
-**(Optional)** To try GitHub Copilot, a [GitHub Copilot account](https://docs.github.com/copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor). A 30-day free trial is available.
87
94
88
95
:::zone-end
89
96
@@ -271,7 +278,7 @@ Follow these steps to create your App Service resources and publish your project
1. In **Name**, enter a unique app name that includes only the valid characters are `a-z`, `A-Z`, `0-9`, and `-`. You can accept the automatically generated unique name. The URL of the web app is `http://<app-name>.azurewebsites.net`, where `<app-name>` is your app name.
277
284
1. Select **Create** to create the Azure resources.
@@ -312,6 +319,10 @@ Follow these steps to create your App Service resources and publish your project
312
319
code .
313
320
```
314
321
1. If prompted, select **Yes, I trust the authors.**
322
+
323
+
> [!TIP]
324
+
> If you have a GitHub Copilot account, try [getting GitHub Copilot features for Visual Studio Code](https://code.visualstudio.com/docs/copilot/overview).
325
+
315
326
1. In Visual Studio Code, open the [**Command Palette**](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) by selecting **View** > **Command Palette**.
316
327
1. Search for and select "Azure App Service: Create New Web App (Advanced)".
317
328
1. Respond to the prompts as follows:
@@ -326,7 +337,7 @@ Follow these steps to create your App Service resources and publish your project
326
337
1. Select a location near you.
327
338
1. Select **Create new App Service plan**, provide a name, and select the **Free (F1)** [pricing tier][app-service-pricing-tier].
328
339
1. Select **Skip for now** for the Application Insights resource.
329
-
1. When prompted, click **Deploy**.
340
+
1. When prompted, select **Deploy**.
330
341
1. Select *MyFirstAzureWebApp* as the folder to deploy.
331
342
1. Select **Add Config** when prompted.
332
343
@@ -496,17 +507,17 @@ Follow these steps to create your App Service resources and publish your project
496
507
497
508
### [.NET 8.0](#tab/net80)
498
509
499
-
- For **Organization** select the organization where you have forked the demo project.
510
+
- For **Organization** select the organization where you forked the demo project.
500
511
- For **Repository** select the *dotnetcore-docs-hello-world* project.
501
-
- For **Branch** select *master*.
512
+
- For **Branch** select *main*.
502
513
503
514
:::image type="content" source="media/quickstart-dotnetcore/app-service-deploy-80.png" lightbox="media/quickstart-dotnetcore/app-service-deploy-80.png" border="true" alt-text="Screenshot of the deployment options for an app using the .NET 8 runtime.":::
504
515
505
516
### [.NET Framework 4.8](#tab/netframework48)
506
517
507
-
- For **Organization** select the organization where you have forked the demo project.
518
+
- For **Organization** select the organization where you forked the demo project.
508
519
- For **Repository** select the *app-service-web-dotnet-get-started* project.
509
-
- For **Branch** select *master*.
520
+
- For **Branch** select *main*.
510
521
511
522
:::image type="content" source="media/quickstart-dotnet/app-service-deploy-48.png" lightbox="media/quickstart-dotnet/app-service-deploy-48.png" border="true" alt-text="Screenshot of the deployment options for an app using the .NET Framework 4.8 runtime.":::
512
523
@@ -539,13 +550,13 @@ Follow these steps to create your App Service resources and publish your project
The AZD template contains files that will generate the following required resources for your application to run in App service:
553
+
The AZD template contains files that generate the following required resources for your application to run in App service:
543
554
544
555
- A new [resource group](../azure-resource-manager/management/overview.md#terminology) to contain all of the Azure resources for the service.
545
556
- A new [App Service plan](overview-hosting-plans.md) that specifies the location, size, and features of the web server farm that hosts your app.
546
557
- A new [App Service app](overview-hosting-plans.md) instance to run the deployed application.
547
558
548
-
1. Sign into your Azure account by using the az login command and following the prompt:
559
+
1. Sign into your Azure account by using the `azd auth login` command and following the prompt:
549
560
550
561
```bash
551
562
azd auth login
@@ -569,7 +580,7 @@ The AZD template contains files that will generate the following required resour
569
580
570
581
## 3. Update the app and redeploy
571
582
572
-
You'll make a change to *Index.cshtml* and redeploy to see the changes. In the .NET 8.0 template, it's located in the *Pages* folder. In the .NET Framework 4.8 template, it's in the *Views/Home* folder. Follow these steps to update and redeploy your web app:
583
+
You'll make a change to *Index.cshtml* and redeploy to see the changes. In the .NET 8.0 template, it's in the *Pages* folder. In the .NET Framework 4.8 template, it's in the *Views/Home* folder. Follow these steps to update and redeploy your web app:
@@ -583,6 +594,12 @@ You'll make a change to *Index.cshtml* and redeploy to see the changes. In the .
583
594
</div>
584
595
```
585
596
597
+
> [!TIP]
598
+
> With GitHub Copilot enabled in Visual Studio, try the following:
599
+
>
600
+
> 1. Select the <div> element and type `Alt`+`/`
601
+
> 1. Ask Copilot, "Change to a Bootstrap card that says .NET 💜 Azure."
602
+
586
603
Save your changes.
587
604
588
605
1. To redeploy to Azure, right-click the **MyFirstAzureWebApp** project in **Solution Explorer** and select **Publish**.
@@ -618,7 +635,13 @@ You'll make a change to *Index.cshtml* and redeploy to see the changes. In the .
618
635
</div>
619
636
```
620
637
621
-
Save your changes.
638
+
> [!TIP]
639
+
> Try this with GitHub Copilot:
640
+
>
641
+
> 1. Select the entire `<div>` element and click :::image type="icon" source="media/quickstart-dotnetcore/github-copilot-in-editor.png" border="false":::.
642
+
> 1. Ask Copilot, "Change to a Bootstrap card that says .NET 💜 Azure."
643
+
644
+
Save your changes.
622
645
623
646
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>.
624
647
1. Search for and select "Azure App Service: Deploy to Web App".
@@ -655,7 +678,7 @@ az webapp up --os-type <os>
655
678
656
679
This command uses values that are cached locally in the *.azure/config* file, including the app name, resource group, and App Service plan.
657
680
658
-
Once deployment has completed, switch back to the browser window that opened in the **Browse to the app** step, and hit refresh.
681
+
Once deployment completes, switch back to the browser window that opened in the **Browse to the app** step, and hit refresh.
659
682
660
683
You see the updated ASP.NET Core 8.0 web app displayed in the page.
661
684
@@ -698,7 +721,7 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
698
721
> [!NOTE]
699
722
> `-ArchivePath` needs the full path of the zip file.
700
723
701
-
1. Once deployment has completed, switch back to the browser window that opened in the **Browse to the app** step, and hit refresh.
724
+
1. Once deployment completes, switch back to the browser window that opened in the **Browse to the app** step, and hit refresh.
702
725
703
726
You see the updated ASP.NET Core 8.0 web app displayed in the page.
704
727
@@ -710,21 +733,21 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
710
733
711
734
1. Browse to your GitHub fork of the sample code.
712
735
713
-
1. On your repo page, press `.` to start Visual Studio Code within your browser.
714
-
715
-
> [!NOTE]
716
-
> The URL will change from GitHub.com to GitHub.dev. This feature only works with repos that have files. This does not work on empty repos.
736
+
1. On your repo page, create a codespace by selecting **Code** > **Create codespace on main**.
717
737
718
738
### [.NET 8.0](#tab/net80)
719
739
720
-

740
+

721
741
722
742
### [.NET Framework 4.8](#tab/netframework48)
723
743
724
-

744
+

725
745
726
746
-----
727
747
748
+
> [!TIP]
749
+
> If you have a GitHub Copilot account, try [getting GitHub Copilot features in your codespace](https://docs.github.com/codespaces/reference/using-github-copilot-in-github-codespaces).
750
+
728
751
1. Open *Index.cshtml*.
729
752
730
753
### [.NET 8.0](#tab/net80)
@@ -750,7 +773,13 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
750
773
</div>
751
774
```
752
775
753
-
The changes are automatically saved.
776
+
The changes are automatically saved.
777
+
778
+
> [!TIP]
779
+
> Try this with GitHub Copilot:
780
+
>
781
+
> 1. Select the entire `<div>` element and click :::image type="icon" source="media/quickstart-dotnetcore/github-copilot-in-editor.png" border="false":::.
782
+
> 1. Ask Copilot, "Change to a Bootstrap card that says .NET 💜 Azure."
754
783
755
784
3. From the **Source Control** menu, enter a commit message such as `Modify homepage`. Then, select **Commit and Push**. The changes are automatically staged for you, then committed and pushed to your fork.
756
785
@@ -764,6 +793,9 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
764
793
765
794
-----
766
795
796
+
> [!TIP]
797
+
> Try letting GitHub Copilot create a commit message for you selecting :::image type="icon" source="media/quickstart-dotnetcore/github-copilot-in-editor.png" border="false"::: in the message box.
798
+
767
799
4. It takes a few minutes for the deployment to run. To view the progress, navigate to `https://github.com/<your-github-alias>/dotnetcore-docs-hello-world/actions`.
768
800
769
801
5. Return to the browser window that opened during the **Browse to the app** step, and refresh the page.
@@ -804,9 +836,9 @@ Save your changes, then redeploy the app using the `azd up` command again:
804
836
azd up
805
837
```
806
838
807
-
`azd up`will skip the provisioning resources step this time and only redeploy your code, since there have been no changes to the Bicep files.
839
+
`azd up`skips the provisioning resources step this time and only redeploys your code, since there are no changes to the Bicep files.
808
840
809
-
Once deployment has completed, the browser will open to the updated ASP.NET Core 8.0 web app.
841
+
Once deployment completes, the browser opens to the updated ASP.NET Core 8.0 web app.
810
842
811
843
:::image type="content" source="media/quickstart-dotnetcore/updated-azure-web-app-net.png" lightbox="media/quickstart-dotnetcore/updated-azure-web-app-net.png" border="true" alt-text="Screenshot of the CLI - Updated ASP.NET Core 8.0 web app in Azure.":::
0 commit comments