Skip to content

Commit 2c47a31

Browse files
author
Cephas Lin
committed
add copilot tips
1 parent e508bf3 commit 2c47a31

File tree

1 file changed

+54
-22
lines changed

1 file changed

+54
-22
lines changed

articles/app-service/quickstart-dotnetcore.md

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ In this quickstart, you learn how to create and deploy your first ASP.NET web ap
4040

4141
Alternatively, you can deploy an ASP.NET web app as part of a [Windows or Linux container in App Service](quickstart-custom-container.md).
4242

43+
> [!TIP]
44+
> Find GitHub Copilot tips in the Visual Studio, Visual Studio Code, and Azure portal steps.
45+
4346
This video shows you how to deploy an ASP.NET web app.
4447
> [!VIDEO 31309745-82c2-4208-aed5-7ace0b7f7f4d]
4548
@@ -53,15 +56,17 @@ The steps in the video are also described in the following sections.
5356

5457
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
5558
- <a href="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.
5660

5761
### [.NET Framework 4.8](#tab/netframework48)
5862

5963
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
6064
- <a href="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.
6166

6267
-----
6368

64-
If you have already installed Visual Studio 2022:
69+
If you already installed Visual Studio 2022:
6570

6671
1. Install the latest updates in Visual Studio by selecting **Help** > **Check for Updates**.
6772
1. Add the workload by selecting **Tools** > **Get Tools and Features**.
@@ -74,6 +79,7 @@ If you have already installed Visual Studio 2022:
7479
- <a href="https://www.visualstudio.com/downloads" target="_blank">Visual Studio Code</a>.
7580
- The <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack" target="_blank">Azure Tools</a> extension.
7681
- <a href="https://dotnet.microsoft.com/download/dotnet/7.0" target="_blank">The latest .NET 8.0 SDK.</a>
82+
- **(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.
7783

7884
:::zone-end
7985

@@ -84,6 +90,7 @@ If you have already installed Visual Studio 2022:
8490
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet).
8591
- The <a href="/cli/azure/install-azure-cli" target="_blank">Azure CLI</a>.
8692
- <a href="https://dotnet.microsoft.com/download/dotnet/8.0" target="_blank">The latest .NET 8.0 SDK.</a>
93+
- **(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.
8794

8895
:::zone-end
8996

@@ -271,7 +278,7 @@ Follow these steps to create your App Service resources and publish your project
271278
|------------------|--------------------------|-----------------------------------------------------------------------|
272279
| **Hosting Plan** | *MyFirstAzureWebAppPlan* | Name of the App Service plan. |
273280
| **Location** | *West Europe* | The datacenter where the web app is hosted. |
274-
| **Size** | *Free* | [Pricing tier][app-service-pricing-tier] determines hosting features. |
281+
| **Size** | Choose the lowest tier. | [Pricing tier][app-service-pricing-tier] determines hosting features. |
275282
276283
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.
277284
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
312319
code .
313320
```
314321
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+
315326
1. In Visual Studio Code, open the [**Command Palette**](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) by selecting **View** > **Command Palette**.
316327
1. Search for and select "Azure App Service: Create New Web App (Advanced)".
317328
1. Respond to the prompts as follows:
@@ -326,7 +337,7 @@ Follow these steps to create your App Service resources and publish your project
326337
1. Select a location near you.
327338
1. Select **Create new App Service plan**, provide a name, and select the **Free (F1)** [pricing tier][app-service-pricing-tier].
328339
1. Select **Skip for now** for the Application Insights resource.
329-
1. When prompted, click **Deploy**.
340+
1. When prompted, select **Deploy**.
330341
1. Select *MyFirstAzureWebApp* as the folder to deploy.
331342
1. Select **Add Config** when prompted.
332343
@@ -496,17 +507,17 @@ Follow these steps to create your App Service resources and publish your project
496507
497508
### [.NET 8.0](#tab/net80)
498509
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.
500511
- For **Repository** select the *dotnetcore-docs-hello-world* project.
501-
- For **Branch** select *master*.
512+
- For **Branch** select *main*.
502513
503514
:::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.":::
504515
505516
### [.NET Framework 4.8](#tab/netframework48)
506517
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.
508519
- For **Repository** select the *app-service-web-dotnet-get-started* project.
509-
- For **Branch** select *master*.
520+
- For **Branch** select *main*.
510521
511522
:::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.":::
512523
@@ -539,13 +550,13 @@ Follow these steps to create your App Service resources and publish your project
539550
540551
:::zone target="docs" pivot="development-environment-azd"
541552
542-
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:
543554
544555
- A new [resource group](../azure-resource-manager/management/overview.md#terminology) to contain all of the Azure resources for the service.
545556
- 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.
546557
- A new [App Service app](overview-hosting-plans.md) instance to run the deployed application.
547558
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:
549560
550561
```bash
551562
azd auth login
@@ -569,7 +580,7 @@ The AZD template contains files that will generate the following required resour
569580
570581
## 3. Update the app and redeploy
571582
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:
573584
574585
:::zone target="docs" pivot="development-environment-vs"
575586
@@ -583,6 +594,12 @@ You'll make a change to *Index.cshtml* and redeploy to see the changes. In the .
583594
</div>
584595
```
585596
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+
586603
Save your changes.
587604
588605
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 .
618635
</div>
619636
```
620637
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.
622645
623646
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>.
624647
1. Search for and select "Azure App Service: Deploy to Web App".
@@ -655,7 +678,7 @@ az webapp up --os-type <os>
655678

656679
This command uses values that are cached locally in the *.azure/config* file, including the app name, resource group, and App Service plan.
657680

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.
659682

660683
You see the updated ASP.NET Core 8.0 web app displayed in the page.
661684

@@ -698,7 +721,7 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
698721
> [!NOTE]
699722
> `-ArchivePath` needs the full path of the zip file.
700723
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.
702725
703726
You see the updated ASP.NET Core 8.0 web app displayed in the page.
704727
@@ -710,21 +733,21 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
710733
711734
1. Browse to your GitHub fork of the sample code.
712735
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**.
717737
718738
### [.NET 8.0](#tab/net80)
719739
720-
![Screenshot of forked dotnetcore-docs-hello-world GitHub repo with an annotation to Press the period key.](media/quickstart-dotnetcore/github-forked-dotnetcore-docs-hello-world-repo-press-period.png)
740+
![Screenshot showing how to create a codespace in the forked dotnetcore-docs-hello-world GitHub repo.](media/quickstart-dotnetcore/github-forked-dotnetcore-docs-hello-world-repo-create-codespace.png)
721741
722742
### [.NET Framework 4.8](#tab/netframework48)
723743
724-
![Screenshot of forked app-service-web-dotnet-get-started GitHub repo with an annotation to Press the period key.](media/quickstart-dotnetcore/github-forked-app-service-web-dotnet-get-started-repo-press-period.png)
744+
![Screenshot showing how to create a codespace in the forked app-service-web-dotnet-get-started GitHub repo.](media/quickstart-dotnetcore/github-forked-app-service-web-dotnet-get-started-repo-create-codespace.png)
725745
726746
-----
727747
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+
728751
1. Open *Index.cshtml*.
729752
730753
### [.NET 8.0](#tab/net80)
@@ -750,7 +773,13 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
750773
</div>
751774
```
752775
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."
754783
755784
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.
756785
@@ -764,6 +793,9 @@ You see the updated ASP.NET Core 8.0 web app displayed in the page.
764793
765794
-----
766795
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+
767799
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`.
768800
769801
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:
804836
azd up
805837
```
806838

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.
808840

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.
810842

811843
:::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.":::
812844

0 commit comments

Comments
 (0)