Skip to content

Commit 1625c37

Browse files
authored
Merge pull request #129868 from ninallam/devops-starter-gh
Add content for DevOps Starter with GH actions
2 parents 42ee9d1 + 9619354 commit 1625c37

File tree

10 files changed

+383
-58
lines changed

10 files changed

+383
-58
lines changed
30.8 KB
Loading
59.1 KB
Loading
41.5 KB
Loading
115 KB
Loading
85.8 KB
Loading
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: 'Quickstart: Create a CI/CD workflow for Node.js - DevOps Starter for GitHub to deploy to Azure'
3+
description: DevOps Starter makes it easy to get started on Azure using GitHub Actions.
4+
author: ninallam
5+
editor: ninallam
6+
ms.assetid:
7+
ms.devlang: na
8+
ms.service: az-devops-project
9+
ms.topic: overview
10+
ms.tgt_pltfrm: na
11+
ms.workload:
12+
ms.date: 08/24/2020
13+
ms.author: ninallam
14+
---
15+
16+
# Set up CI/CD for a Node.js app with DevOps Starter using GitHub Actions
17+
18+
In this quickstart, you use the simplified DevOps Starter experience to set up a continuous integration (CI) and continuous delivery (CD) workflow for your Node.js app using GitHub Actions. You can use DevOps Starter to set up everything you need for developing, deploying, and monitoring your app.
19+
20+
## Prerequisites
21+
22+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
23+
- A [GitHub](https://github.com/) account.
24+
25+
## Sign in to the Azure portal
26+
27+
DevOps Starter creates a CI/CD workflow using GitHub actions. DevOps Starter also creates Azure resources in the Azure subscription of your choice.
28+
29+
1. Sign in to the [Azure portal](https://portal.azure.com).
30+
31+
1. In the search box, type **DevOps Starter**, and then select. Click on **Add** to create a new one.
32+
33+
![The DevOps Starter dashboard](_img/azure-devops-starter-aks/search-devops-starter.png)
34+
35+
## Select a sample application and Azure service
36+
37+
1. Click on **Set up DevOps starter with GitHub** on the right side banner.
38+
39+
![landing_page](_img/azure-devops-project-nodejs/landing-page.png)
40+
41+
1. Ensure that the CI/CD provider is selected as **GitHub Actions**.
42+
43+
![CICD_provider](_img/azure-devops-project-nodejs/provider-selection.png)
44+
45+
1. Select the **Node.js** sample application. The Node.js samples include a choice of several application frameworks.
46+
47+
1. The default sample framework is **Express.js**. Leave the default setting, and then select **Next**.
48+
49+
2. Windows Web App is the default deployment target. The application framework, which you chose previously, dictates the type of Azure service deployment target available here. Leave the default service, and then select **Next**.
50+
51+
## Configure GitHub account and an Azure subscription
52+
53+
1. Authenticate with GitHub.
54+
55+
1. Click on the **Authorize** button.
56+
57+
1. Sign in to GitHub. If you don't have a GitHub account, you can sign up here as well.
58+
59+
2. Choose an existing **GitHub organization**.
60+
61+
1. Choose a name for your GitHub repository.
62+
63+
1. Select your Azure subscription and location, choose a name for your application, and then select **Done**.
64+
65+
![Enter_GH_details](_img/azure-devops-project-nodejs/gh-details.png)
66+
67+
68+
After a few minutes, the DevOps Starter dashboard is displayed in the Azure portal. A sample application is set up in a repository in your Azure DevOps organization, a GitHub workflow is triggered, and your application is deployed to Azure. This dashboard provides visibility into your code repository, the GitHub workflow, and your application in Azure.
69+
70+
3. Select **Browse** to view your running application.
71+
72+
The dashboard contains details of GitHub workflow and Azure resources. To view the details of GitHub workflow like latest run, commits, and job status you will need to **Authorize to GitHub**.
73+
74+
![Authorize_dashboard](_img/azure-devops-project-nodejs/authenticate-dashboard.png)
75+
76+
DevOps Starter automatically configured a GitHub workflow with build and deploy jobs using GitHub actions. You're now ready to collaborate with a team on a Node.js app with a CI/CD process that automatically deploys your latest work to your web site.
77+
78+
![dashooard_view](_img/azure-devops-project-nodejs/full-dashboard.png)
79+
80+
## Commit code changes and execute CI/CD
81+
82+
DevOps Starter creates a repository in GitHub. To view the repository and make code changes to your application, do the following:
83+
84+
1. On the left of the DevOps Starter dashboard, select the link for your master branch. This link opens a view to the newly created GitHub repository.
85+
86+
1. To view the repository clone URL, select **Clone** on the top right of the browser. You can clone your Git repository in your favorite IDE. In the next few steps, you can use the web browser to make and commit code changes directly to the master branch.
87+
88+
1. On the left side of the browser, go to the **/Application/views/index.pug** file.
89+
90+
1. Select **Edit**, and then make a change to some of the text.
91+
For example, change some of the text for one of the tags.
92+
93+
1. Select **Commit**, and then save your changes.
94+
95+
1. In your browser, go to the DevOps Starter dashboard.
96+
You should now see a GitHub workflow build job in progress. The changes you made are automatically built and deployed via a GitHub workflow.
97+
98+
## View the GitHub workflow
99+
100+
In the previous step, DevOps Starter automatically configured a full GitHub workflow. Explore and customize the workflow as needed. Take the following steps to familiarize yourself with the workflow.
101+
102+
1. On the left of the DevOps Starter dashboard, select **GitHub workflow**. This link opens a browser tab and the GitHub workflow for your new project.
103+
> [!NOTE]
104+
> Do not rename the workflow file. The name of the workflow file should be **devops-starter-workflow.yml** for the dashboard to reflect the changes
105+
106+
1. The workflow yaml file contains all the GitHub Actions required to build and deploy the application. Click on **edit file** option to customize your workflow file.
107+
108+
1. Under the **Code** tab of the repo click on **commits**. This view shows code commits that are associated with the specific deployment.
109+
110+
1. Under the **Actions** tab of the repo, you can view the history of all the workflow runs of your repository.
111+
112+
1. Select the **latest run** to view all the jobs that ran in the workflow.
113+
114+
1. Click on the **jobs** to view the detailed logs of the workflow run. The logs contain useful information about the deployment process. They can be viewed both during and after deployments.
115+
116+
1. Click on the **Pull request** tab to view all the pull requests on your repository
117+
118+
## Clean up resources
119+
120+
You can delete Azure App Service and other related resources when you don't need them anymore. Use the **Delete** functionality on the DevOps Starter dashboard.
121+
122+
## Next steps
123+
124+
When you configured your CI/CD process, GitHub workflow was automatically created. You can modify this workflow to meet the needs of your team. To learn more about the GitHub Actions and workflow, see:
125+
126+
> [!div class="nextstepaction"]
127+
> [Customize GitHub workflow](https://docs.github.com/actions/configuring-and-managing-workflows/configuring-and-managing-workflow-files-and-runs)
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
title: 'Tutorial: Deploy your Node.js app to Azure Web App by using DevOps Starter for GitHub Actions'
3+
description: DevOps Starter makes it easy to get started on Azure and to deploy your Node.js app to Azure Web App in a few quick steps.
4+
ms.author: ninallam
5+
ms.prod: devops
6+
ms.technology: devops-cicd
7+
ms.topic: tutorial
8+
ms.date: 08/25/2020
9+
author: ninallam
10+
---
11+
12+
# Tutorial: Deploy Node.js app to Azure Web App using DevOps Starter for GitHub Actions
13+
14+
DevOps Starter for GitHub Actions presents a simplified experience where you can choose a sample application to create a continuous integration (CI) and continuous delivery (CD) workflow to deploy to Azure.
15+
16+
DevOps Starter also:
17+
* Automatically creates Azure resources, such as a new Azure Web App.
18+
* Creates and configures a workflow in GitHub that includes a build job for CI.
19+
* The workflow also contains a deploy job for CD.
20+
* Creates an Azure Application Insights resource for monitoring.
21+
22+
In this tutorial, you will:
23+
24+
> [!div class="checklist"]
25+
> * Use DevOps Starter to deploy a Node.js app
26+
> * Configure GitHub and an Azure subscription
27+
> * Examine the GitHub workflow
28+
> * Commit changes to GitHub and automatically deploy them to Azure
29+
> * Configure Azure Application Insights monitoring
30+
> * Clean up resources
31+
32+
## Prerequisites
33+
34+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
35+
36+
## Use DevOps Starter to deploy a Node.js app
37+
38+
DevOps Starter creates a workflow in GitHub. You can use an existing GitHub organization. DevOps Starter also creates Azure resources such as Web App in the Azure subscription of your choice.
39+
40+
1. Sign in to the [Azure portal](https://portal.azure.com).
41+
42+
1. In the search box, type **DevOps Starter**, and then select. Click on **Add** to create a new one.
43+
44+
![The DevOps Starter dashboard](_img/azure-devops-starter-aks/search-devops-starter.png)
45+
46+
1. Ensure that the CI/CD provider is selected as **GitHub Actions**.
47+
48+
![CICD_provider](_img/azure-devops-project-nodejs/provider-selection.png)
49+
50+
1. Select **Node.js**, and then select **Next**.
51+
52+
1. Under **Choose an application Framework**, select **Express.js**, and then select **Next**. The application framework, which you chose in a previous step, dictates the type of Azure service deployment target that's available here.
53+
54+
1. Select the **Windows Web App**, and then select **Next**.
55+
56+
## Configure GitHub and an Azure subscription
57+
58+
1. **Authorize** GitHub and select an existing GitHub organization.
59+
60+
1. Enter a name for your **GitHub Repository**.
61+
62+
1. Select your Azure subscription services. Optionally, you can select **Change** and then enter more configuration details, such as the location of the Azure resources.
63+
64+
1. Enter a Web App name, and then select **Done**. After a few minutes, the Azure Web App will be ready. A sample Node.js application is set up in a repo in your GitHub organization, a workflow is triggered, and your application is deployed to the newly created Azure Web App.
65+
66+
![Enter_GH_details](_img/azure-devops-project-nodejs/gh-details.png)
67+
68+
After it's completed, the DevOps Starter dashboard is displayed in the Azure portal. You can also navigate to the dashboard directly from **All resources** in the Azure portal.
69+
70+
The dashboard provides visibility into your GitHub code repo, your CI/CD workflow, and your running application in Azure.
71+
72+
![Dashboard view](_img/azure-devops-project-nodejs/full-dashboard.png)
73+
74+
DevOps Starter automatically configures a trigger that deploys code changes to your repo.
75+
76+
## Examine the GitHub workflow
77+
78+
In the previous step, DevOps Starter automatically configured a full GitHub workflow. Explore and customize the workflow as needed. Take the following steps to familiarize yourself with the workflow.
79+
80+
1. On the left of the DevOps Starter dashboard, select **GitHub workflow**. This link opens a browser tab and the GitHub workflow for your new project.
81+
> [!NOTE]
82+
> Do not rename the workflow file. The name of the workflow file should be **devops-starter-workflow.yml** for the dashboard to reflect the changes
83+
84+
1. The workflow yaml file contains all the GitHub Actions required to build and deploy the application. Click on **edit file** option to customize your workflow file.
85+
86+
1. Under the **Code** tab of the repo click on **commits**. This view shows code commits that are associated with the specific deployment.
87+
88+
1. Under the **Actions** tab of the repo you can view the history of all the workflow runs of your repository.
89+
90+
1. Select the **latest run** to view all the jobs that ran in the workflow.
91+
92+
1. Click on the **jobs** to view the detailed logs of the workflow run. The logs contain useful information about the deployment process. They can be viewed both during and after deployments.
93+
94+
1. Click on the **Pull request** tab to view all the pull requests on your repository
95+
96+
## Commit code changes and execute CI/CD
97+
98+
DevOps Starter creates a repository in GitHub. To view the repository and make code changes to your application, do the following:
99+
100+
1. On the left of the DevOps Starter dashboard, select the link for your master branch. This link opens a view to the newly created GitHub repository.
101+
102+
1. To view the repository clone URL, select **Clone** on the top right of the browser. You can clone your Git repository in your favorite IDE. In the next few steps, you can use the web browser to make and commit code changes directly to the master branch.
103+
104+
1. On the left side of the browser, go to the **/Application/views/index.pug** file.
105+
106+
1. Select **Edit**, and then make a change to some of the text.
107+
For example, change some of the text for one of the tags.
108+
109+
1. Select **Commit**, and then save your changes.
110+
111+
1. In your browser, go to the DevOps Starter dashboard.
112+
You should now see a GitHub workflow build job in progress. The changes you just made are automatically built and deployed via a GitHub workflow.
113+
114+
1. After the deploy is completed, refresh your application to verify your changes.
115+
116+
## Configure Azure Application Insights monitoring
117+
118+
With Azure Application insights, you can easily monitor your application's performance and usage. DevOps Starter automatically configures an Application Insights resource for your application. You can further configure various alerts and monitoring capabilities as needed.
119+
120+
1. In the Azure portal, go to the DevOps Starter dashboard.
121+
122+
1. At the lower right, select the **Application Insights** link for your app. The **Application Insights** pane opens. This view contains usage, performance, and availability monitoring information for your app.
123+
124+
![The Application Insights pane](_img/azure-devops-project-github/appinsights.png)
125+
126+
1. Select **Time range**, and then select **Last hour**. To filter the results, select **Update**. You can now view all activity from the last 60 minutes.
127+
128+
1. To exit the time range, select **x**.
129+
130+
1. Select **Alerts**, and then select **Add metric alert**.
131+
132+
1. Enter a name for the alert.
133+
134+
1. In the **Metric** drop-down list, examine the various alert metrics. The default alert is for a **server response time greater than 1 second**. You can easily configure a variety of alerts to improve the monitoring capabilities of your app.
135+
136+
1. Select the **Notify via Email owners, contributors, and readers** check box. Optionally, you can perform additional actions when an alert is displayed by executing an Azure logic app.
137+
138+
1. Select **OK** to create the alert. After a few moments, the alert appears as active on the dashboard.
139+
140+
1. Exit the **Alerts** area, and go back to the **Application Insights** pane.
141+
142+
1. Select **Availability**, and then select **Add test**.
143+
144+
1. Enter a test name, and then select **Create**. A simple ping test is created to verify the availability of your application. After a few minutes, test results are available, and the Application Insights dashboard displays an availability status.
145+
146+
## Clean up resources
147+
148+
If you are testing, you can avoid accruing billing charges by cleaning up your resources. When they are no longer needed, you can delete the Azure virtual machine and related resources that you created in this tutorial. To do so, use the **Delete** functionality on the DevOps Starter dashboard.
149+
150+
> [!IMPORTANT]
151+
> The following procedure permanently deletes resources. The *Delete* functionality destroys the data that's created by the project in DevOps Starter in both Azure, and you will be unable to retrieve it. Use this procedure only after you've carefully read the prompts.
152+
153+
1. In the Azure portal, go to the DevOps Starter dashboard.
154+
1. At the top right, select **Delete**.
155+
1. At the prompt, select **Yes** to *permanently delete* the resources.
156+
157+
You can optionally modify the workflow to meet the needs of your team. You can also use this CI/CD pattern as a template for your other repositories.
158+
159+
## Next steps
160+
161+
In this tutorial, you learned how to:
162+
163+
> [!div class="checklist"]
164+
> * Use DevOps Starter to deploy a Node.js app
165+
> * Configure GitHub and an Azure subscription
166+
> * Examine the GitHub workflow
167+
> * Commit changes to GitHub and automatically deploy them to Azure
168+
> * Configure Azure Application Insights monitoring
169+
> * Clean up resources
170+
171+
To learn more about GitHub Actions and workflows, see:
172+
173+
> [!div class="nextstepaction"]
174+
> [Customize GitHub workflow](https://docs.github.com/actions/configuring-and-managing-workflows/configuring-and-managing-workflow-files-and-runs)

articles/devops-project/index.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
### YamlMime:Landing
22

3-
title: Azure DevOps Starter documentation
4-
summary: Azure DevOps Starter presents a simplified experience where you bring your existing code and Git repository, or choose from one of the sample applications to create a continuous integration (CI) and continuous delivery (CD) pipeline to Azure.
3+
title: DevOps Starter documentation to deploy to Azure
4+
summary: DevOps Starter presents a simplified experience where you bring your existing code and Git repository, or choose from one of the sample applications to create a continuous integration (CI) and continuous delivery (CD) pipeline or workflow to Azure. DevOps Starter now supports creating GitHub actions workflows.
55

66
metadata:
7-
title: Azure DevOps Starter documentation
7+
title: DevOps Starter documentation
88
description: Bring your existing code and Git repository or choose a sample app to create a continuous integration (CI) and continuous delivery (CD) pipeline to Azure.
99
ms.service: devops-project
1010
ms.topic: landing-page
@@ -16,22 +16,24 @@ metadata:
1616

1717
landingContent:
1818
# Card
19-
- title: About Azure DevOps Starter
19+
- title: About DevOps Starter
2020
linkLists:
2121
- linkListType: overview
2222
links:
23-
- text: What is Azure DevOps Starter?
23+
- text: What is DevOps Starter?
2424
url: overview.md
2525
- linkListType: video
2626
links:
27-
- text: Create CI/CD with the DevOps Starter video (8:53)
27+
- text: Create CI/CD with the DevOps Starter using Azure DevOps (8:53)
2828
url: https://channel9.msdn.com/Events/Connect/2017/T174/player/
2929

3030
# Card (optional)
31-
- title: Create a CI/CD pipeline
31+
- title: Configure CI/CD
3232
linkLists:
3333
- linkListType: quickstart
3434
links:
35+
- text: Node.js using GitHub actions
36+
url: /azure/devops-project/devops-starter-gh-nodejs
3537
- text: .NET
3638
url: ./azure-devops-project-aspnet-core.md
3739
- text: Node.js
@@ -48,10 +50,12 @@ landingContent:
4850
url: ./azure-devops-project-go.md
4951

5052
# Card
51-
- title: Create release pipelines
53+
- title: Deploy to Azure
5254
linkLists:
5355
- linkListType: tutorial
5456
links:
57+
- text: Deploy your app to Azure Web App using GitHub actions
58+
url: devops-starter-gh-web-app.md
5559
- text: Bring your own code with GitHub
5660
url: azure-devops-project-vms.md
5761
- text: Deploy your ASP.NET app to Azure Virtual Machines
@@ -61,4 +65,4 @@ landingContent:
6165
- text: Deploy your app to Azure Container Service and Kubernetes
6266
url: azure-devops-project-aks.md
6367
- text: Deploy your app to Azure Service Fabric
64-
url: azure-devops-project-service-fabric.md
68+
url: azure-devops-project-service-fabric.md

0 commit comments

Comments
 (0)