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: content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/_index.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
---
2
-
title: Deploy a .NET application with GitHub Actions on Azure Cobalt 100 VMs
2
+
title: Deploy a .NET application on Microsoft Azure Cobalt 100 VMs
3
3
4
4
minutes_to_complete: 60
5
5
6
-
who_is_this_for: This is an advanced topic for software developers who want to develop cloudnative applications using GitHub Actions and Azure Kubernetes Service (AKS)
6
+
who_is_this_for: This is an advanced topic for software developers who want to develop cloud-native applications using GitHub Actions and Azure Kubernetes Service (AKS), and run them on Microsoft Azure Cobalt 100 VMs.
7
7
8
8
learning_objectives:
9
9
- Configure an Azure Cobalt 100 VM as a self-hosted GitHub runner.
10
10
- Create an AKS cluster with Arm-based Azure Cobalt 100 nodes using Terraform.
11
-
- Deploy a .NET application to AKS with GitHub Actions using the self-hosted Arm64based runner.
11
+
- Deploy a .NET application to AKS with GitHub Actions using the self-hosted Arm64-based runner.
12
12
13
13
prerequisites:
14
-
- A Microsoft Azure account. Create an account if needed.
15
-
- A valid GitHub account
16
-
- A machine with [Terraform](/install-guides/terraform/),[Azure CLI](/install-guides/azure-cli), and [Kubectl](/install-guides/kubectl/) installed
14
+
- A Microsoft Azure account.
15
+
- A GitHub account.
16
+
- A machine with [Terraform](/install-guides/terraform/),[Azure CLI](/install-guides/azure-cli), and [Kubectl](/install-guides/kubectl/) installed.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/_review.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,22 @@
2
2
review:
3
3
- questions:
4
4
question: >
5
-
.NET basedapplications can be deployed on Azure Cobalt 100 Arm-based VMs.
5
+
.NET based-applications can be deployed on Azure Cobalt 100 Arm-based VMs.
6
6
answers:
7
7
- "True"
8
8
- "False"
9
9
correct_answer: 1
10
10
explanation: >
11
-
Arm Neoversebased Azure Cobalt 100 VMs support .NET based applications.
11
+
Arm Neoverse-based Azure Cobalt 100 VMs support .NET based applications.
12
12
- questions:
13
13
question: >
14
-
What is the generalpurpose VM series supported by Azure Cobalt 100 processors?
14
+
What is the general-purpose VM series supported by Azure Cobalt 100 processors?
15
15
answers:
16
16
- "Dpsv6"
17
17
- "Epsv6"
18
18
correct_answer: 1
19
19
explanation: >
20
-
Generalpurpose VM series Dpsv6 and Dplsv6 are based on Azure Cobalt 100 processors. Epsv6 series VMs are memoryoptimized VMs based on Azure Cobalt 100 processors.
20
+
General-purpose VM series Dpsv6 and Dplsv6 are based on Azure Cobalt 100 processors. Epsv6 series VMs are memory-optimized VMs based on Azure Cobalt 100 processors.
21
21
- questions:
22
22
question: >
23
23
GitHub Actions does not support Arm-based runners.
@@ -26,7 +26,7 @@ review:
26
26
- "False"
27
27
correct_answer: 2
28
28
explanation: >
29
-
GitHub provides both self-hosted and managed Arm-based runners for developing cloud native applications natively on Arm.
29
+
GitHub provides both self-hosted and managed Arm-based runners for developing cloud- native applications natively on Arm.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/azure-cobalt.md
+75-47Lines changed: 75 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,73 +1,96 @@
1
1
---
2
-
title: "Create self-hosted GitHub Actions Runner and AKS cluster based on Arm-based Microsoft Cobalt VMs"
2
+
title: "Build and deploy a .NET application"
3
3
4
-
weight: 2
4
+
weight: 3
5
5
6
6
layout: "learningpathall"
7
7
---
8
8
9
-
## Overview
10
-
11
-
In this learning path, you will build a .NET 8 based web application using a self-hosted GitHub Actions Arm64 runner. You will deploy the application in a Azure Kubernetes Cluster, running on Microsoft Cobalt 100 based VMs. Self-hosted runners offer more control and flexibility in terms of infrastructure, operating systems and tools than GitHub-hosted runners.
9
+
In this Learning Path, you will build a .NET 8-based web application using a self-hosted GitHub Actions Arm64 runner. You will deploy the application in an Azure Kubernetes Cluster, running on Microsoft Cobalt 100-based VMs. Self-hosted runners offer increased control and flexibility in terms of infrastructure, operating systems, and tools, in comparison to GitHub-hosted runners.
12
10
13
11
{{% notice Note %}}
14
-
GitHub hosted Arm64 runners are now Generally Available. If your GitHub account is part of a Team or an Enterprise Cloud plan, you can use GitHub hosted Arm64 runners. Follow this [learning path](/learning-paths/cross-platform/github-arm-runners/) to understand how you can configure a GitHub managed runner.
12
+
* GitHub-hosted Arm64 runners have now reached General Availability. If your GitHub account is part of a Team or an Enterprise Cloud plan, you can use GitHub-hosted Arm64 runners.
13
+
14
+
* To learn how you can configure a GitHub-managed runner, see the Learning Path [*Build multi-architecture container images with GitHub Arm-hosted runners*](/learning-paths/cross-platform/github-arm-runners/).
15
15
{{% /notice %}}
16
16
17
-
## What is Azure Cobalt 100?
17
+
## How do I create an Azure Virtual Machine?
18
+
Creating a virtual machine based on Azure Cobalt 100 is no different from creating any other VM in Azure. To create an Azure virtual machine, launch the [Azure portal](https://portal.azure.com/) and navigate to Virtual Machines.
18
19
19
-
Cobalt 100 is Microsoft’s first Arm-based server processor, built using the Armv9 Neoverse-N2 CPU. The Cobalt 100 processor is optimized for the performance of scale out cloud-based applications. The Azure Cobalt 100 VM instances include: General purpose -`Dpsv6 and Dplsv6` and Memory optimized - `Epsv6`virtual machines. To learn more about Azure Cobalt 100 refer to this [blog](https://techcommunity.microsoft.com/t5/azure-compute-blog/announcing-the-preview-of-new-azure-vms-based-on-the-azure/ba-p/4146353).
20
+
Select `Create Azure Virtual Machine`, and fill in the details such as `Name`, and `Region`.
20
21
21
-
Creating a virtual machine based on Azure Cobalt 100 is no different than creating any other VM in Azure. To create this VM, launch the [Azure portal](https://portal.azure.com/) and navigate to Virtual Machines. Select `Create Azure Virtual Machine` in the portal and fill in the details like `Name`, `Region` etc. In the `Size` field, click on `See all sizes` and select the `D-Series v6` family of VMs. Select `D2psv6` from the list and create the VM.
22
+
In the `Size` field, click on `See all sizes` and select the `D-Series v6` family of VMs. Select `D2psv6` from the list and create the VM.
To learn more about Arm-based VMs in Azure, refer to this [learning path](/learning-paths/servers-and-cloud-computing/csp/azure)
26
+
{{% notice Note %}}
27
+
To learn more about Arm-based VMs in Azure, refer to "Getting Started with Microsoft Azure" in [*Get started with Arm-based cloud instances*](/learning-paths/servers-and-cloud-computing/csp/azure).
28
+
{{% /notice %}}
29
+
30
+
## How do I configure the GitHub repository?
26
31
27
-
## Configure GitHub Repository
32
+
The source code for the application and configuration files that you require to follow this Learning Path are hosted in this [msbuild-azure github repository](https://github.com/pbk8s/msbuild-azure). This repository also contains the Dockerfile and Kubernetes deployment manifests that you require to deploy the .NET 8 based application.
28
33
29
-
The source code for the application and configuration files required to follow this learning path are hosted in this [github repository](https://github.com/pbk8s/msbuild-azure). This repository also contains the Dockerfile and Kubernetes deployment manifests required to deploy this .NET 8 based application.
34
+
Follow these steps:
30
35
31
-
Start by forking this repository.
36
+
*Start by forking the repository.
32
37
33
-
Once the GitHub repository is forked successfully, navigate to the `Settings` tab and click `Actions` in the left navigation pane. In `Runners`, select `New self-hosted runner` which opens up a new page to configure the runner. For `Runner image` select `Linux` and `Architecture` as `ARM64`. Execute the commands shown on this page on the `D2psv6` VM you created in previous step.
38
+
*Once the GitHub repository is forked, navigate to the `Settings` tab, and click on `Actions` in the left navigation pane.
34
39
35
-
Once the runner is configured successfully, you will see a self-hosted runner appear on the same page in GitHub.
40
+
* In `Runners`, select `New self-hosted runner`, which opens up a new page to configure the runner.
36
41
37
-
To learn more about creating an Arm-based self-hosted runner refer to this [learning path](/learning-paths/laptops-and-desktops/self_hosted_cicd_github/)
42
+
* For `Runner image`, select `Linux`, and for `Architecture`, select `ARM64`.
43
+
44
+
* Using the commands shown, execute them on the `D2psv6` VM you created in the previous step.
45
+
46
+
* Once you have configured the runner successfully, you will see a self-hosted runner appear on the same page in GitHub.
47
+
48
+
{{% notice Note %}}
49
+
To learn more about creating an Arm-based self-hosted runner, see this Learning Path [*Use Self-Hosted Arm64-based runners in GitHub Actions for CI/CD*](/learning-paths/laptops-and-desktops/self_hosted_cicd_github/).
50
+
{{% /notice %}}
38
51
39
-
## Create an AKS cluster with Arm-based Azure Cobalt 100 nodes using Terraform
52
+
## How do I create an AKS cluster with Arm-based Azure Cobalt 100 nodes using Terraform?
40
53
41
-
You can create an Arm-based AKS cluster by following the steps in this [learning path](/learning-paths/servers-and-cloud-computing/aks/cluster-deployment/). Make sure to update the `main.tf` file with the correct VM as shown:
54
+
You can create an Arm-based AKS cluster by following the steps in this Learning Path [*Create an Arm-based Kubernetes cluster on Microsoft Azure Kubernetes Service*](/learning-paths/servers-and-cloud-computing/aks/cluster_deployment/).
55
+
56
+
Make sure to update the `main.tf` file with the correct VM as shown below:
42
57
43
58
```console
44
59
`vm_size` = `Standard_D2ps_v6`
45
60
```
46
-
Once the cluster creation is successful, you can proceed to the next section.
61
+
Once you have successfully created the cluster, you can proceed to the next section.
47
62
48
-
## Create container registry with ACR
63
+
## How do I create a container registry with Azure Container Registry (ACR)?
49
64
50
-
Create a container registry in Azure Container Registry to host the docker images for your application. Use the following command to create the registry:
65
+
To create a container registry in Azure Container Registry to host the Docker images for your application, use the following command:
51
66
52
67
```console
53
68
az acr create --resource-group myResourceGroup --name mycontainerregistry
54
69
```
55
-
## Setup GitHub Secrets
70
+
## How do I set up GitHub Secrets?
71
+
72
+
The next step allows GitHub Actions to access the Azure Container Registry to push application docker images and Azure Kubernetes Service to deploy application pods.
73
+
74
+
Create the following secrets in your GitHub repository:
75
+
76
+
- Populate `ACR_Name` with the name of your Azure Container Registry.
77
+
- Populate `AZURE_CREDENTIALS` with Azure Credentials of a Service Principal.
78
+
- Populate `CLUSTER_NAME` with the name of your AKS cluster.
79
+
- Populate `CLUSTER_RESOURCE_GROUP_NAME` with the name of your resource group.
80
+
81
+
Refer to this [guide](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure-secret) for further information about signing into Azure using GitHub Actions.
56
82
57
-
GitHub Actions needs access to Azure Container Registry to push application docker images and Azure Kubernetes Service to deploy application pods. Create the following secrets in your GitHub repository:
83
+
## Deploy a .NET-based application
58
84
59
-
-`ACR_Name` with the name of your Azure Container Registry
60
-
-`AZURE_CREDENTIALS` with Azure Credentials of a Service Principal
61
-
-`CLUSTER_NAME` with the name of your AKS cluster
62
-
-`CLUSTER_RESOURCE_GROUP_NAME` with the name of your resource group
85
+
.NET added support for Arm64 applications starting with version 6. Several performance enhancements have been made in later versions. The latest version that supports Arm64 targets is .NET 9. In this Learning Path, you will use the .NET 8 SDK for application development.
63
86
64
-
Refer to this [guide](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure-secret) if you need help with signing into Azure using GitHub Actions.
87
+
Follow these steps:
65
88
66
-
## Deploy a .NET based application
89
+
* In your fork of the GitHub repository, inspect the `aks-ga-demo.csproj` file.
67
90
68
-
.NET added support for arm64 applications starting with version 6. Several performance enhancements have been made in later versions. The latest version that supports Arm64 targets is .NET 9. In this learning path you will use the .NET 8 SDK for application development.
91
+
* Verify that the `TargetFramework` field has `net8.0` as the value.
69
92
70
-
In your fork of the github repository inspect the `aks-ga-demo.csproj` file. Verify that the `TargetFramework` field has `net8.0` as the value. The contents of the file are shown below:
93
+
The contents of the file are shown below:
71
94
72
95
```console
73
96
<Project Sdk="Microsoft.NET.Sdk.Web">
@@ -82,10 +105,13 @@ In your fork of the github repository inspect the `aks-ga-demo.csproj` file. Ver
82
105
83
106
You can inspect the contents of the `Dockerfile` within your repository as well. This is a multi-stage Dockerfile with the following stages:
84
107
85
-
1.`base` stage - Prepares the base environment with the `.NET 8 SDK` and exposes ports 80 and 443.
86
-
2.`build` stage - Restores dependencies and builds the application
87
-
3.`publish` stage - Publishes the application making it ready for deployment
88
-
4.`final` stage - Copies the published application into the final image and sets the entry point to run the application
108
+
1.`base` stage - prepares the base environment with the `.NET 8 SDK` and exposes ports 80 and 443.
109
+
110
+
2.`build` stage - restores dependencies and builds the application.
111
+
112
+
3.`publish` stage - publishes the application making it ready for deployment.
113
+
114
+
4.`final` stage - copies the published application into the final image and sets the entry point to run the application.
Now, navigate to the `k8s` folder and check the Kubernetes yaml files. The `deployment.yml` file defines a deployment for the application. It specifies the container image to use from ACR and exposes port 80 for the application. The deployment ensures that the application runs with the defined resource constraints and is accessible on the specified port.
139
+
Next, navigate to the `k8s` folder and check the Kubernetes yaml files. The `deployment.yml` file defines a deployment for the application. It specifies the container image to use from ACR and exposes port 80 for the application. The deployment ensures that the application runs with the defined resource constraints and is accessible on the specified port.
114
140
115
141
```yaml
116
142
apiVersion: apps/v1
@@ -153,7 +179,7 @@ spec:
153
179
targetPort: 80
154
180
```
155
181
156
-
Finally, let's look at the GitHub Actions file located at `.github/workflows/deploytoAKS.yml`
182
+
Finally, have a look at the GitHub Actions file located at `.github/workflows/deploytoAKS.yml`
This GitHub Actions yaml file defines a workflow to deploy a .NET application to Azure Kubernetes Service (AKS). This workflow runs on a self-hosted GitHub Actions runner that you configured earlier. This workflow can be triggered manually or on a push to the repository. It has the following main steps:
238
+
This GitHub Actions yaml file defines a workflow to deploy a .NET application to Azure Kubernetes Service (AKS). This workflow runs on the self-hosted GitHub Actions runner that you configured in a previous step. This workflow can be triggered manually, or on a push to the repository.
239
+
240
+
It has the following main steps:
213
241
214
-
1. `Checkout repo` - Checks out the repository code
215
-
2. `Build image` - Builds a Docker image of the application
216
-
3. `Azure login` - Logs into Azure using stored credentials in GitHub Secrets
217
-
4. `ACR login` - Logs into Azure Container Registry (ACR)
218
-
5. `Tag and push image` - Tags and pushes the Docker image to Azure Container Registry
219
-
6. `Get AKS credentials` - Retrieves Azure Kubernetes Cluster credentials
220
-
7. `Deploy application` - Deploys the application to AKS using specified Kubernetes manifests
242
+
1. `Checkout repo` - checks out the repository code.
243
+
2. `Build image` - builds a Docker image of the application.
244
+
3. `Azure login` - logs in to Azure using stored credentials in GitHub Secrets.
245
+
4. `ACR login` - logs in to Azure Container Registry (ACR).
246
+
5. `Tag and push image` - tags and pushes the Docker image to Azure Container Registry.
247
+
6. `Get AKS credentials` - retrieves Azure Kubernetes Cluster credentials.
248
+
7. `Deploy application` - deploys the application to AKS using specified Kubernetes manifests.
221
249
222
-
## Run the CI/CD pipeline
250
+
## How do I run the CI/CD pipeline?
223
251
224
-
Trigger the pipeline manually by navigating to `Actions` tab in the GitHub repository. Select `Deploy .NET app` and click on `Run Workflow`. You can also execute the pipeline by making a commit to the repository. Once the pipeline executes successfully, you should Actions output similar to what is shown below:
252
+
The next step is to trigger the pipeline manually by navigating to `Actions` tab in the GitHub repository. Select `Deploy .NET app`, and click on `Run Workflow`. You can also execute the pipeline by making a commit to the repository. Once the pipeline executes successfully, you will see the Actions output in a format similar to what is shown below:
## What is the Azure Cobalt 100 Arm-based processor?
10
+
11
+
Cobalt 100 is Microsoft’s first Arm-based server processor, built using the Armv9 Neoverse-N2 CPU.
12
+
13
+
The Cobalt 100 processor is optimized for the performance of scale-out cloud-based applications.
14
+
15
+
The Azure Cobalt 100 VM instances include two series:
16
+
17
+
* The general-purpose `Dpsv6 and Dplsv6` virtual machine series.
18
+
* The memory-optimized `Epsv6` virtual machine series.
19
+
20
+
To learn more about Azure Cobalt 100, refer to the blog ["Announcing the preview of new Azure VMs based on the Azure Cobalt 100 processor"](https://techcommunity.microsoft.com/t5/azure-compute-blog/announcing-the-preview-of-new-azure-vms-based-on-the-azure/ba-p/4146353).
0 commit comments