Skip to content

Commit f085228

Browse files
authored
Merge pull request #1290 from madeline-underwood/Cobalt
Cobalt_LP_KB to review
2 parents 1f1bccd + 05339af commit f085228

File tree

5 files changed

+108
-59
lines changed

5 files changed

+108
-59
lines changed

content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/_index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
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
33

44
minutes_to_complete: 60
55

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)
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.
77

88
learning_objectives:
99
- Configure an Azure Cobalt 100 VM as a self-hosted GitHub runner.
1010
- 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 Arm64 based runner.
11+
- Deploy a .NET application to AKS with GitHub Actions using the self-hosted Arm64-based runner.
1212

1313
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.
1717

1818
author_primary: Pranay Bakre
1919

content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/_next-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
next_step_guidance: >
3-
.NET based applications are supported on both Linux and Windows on Arm. Continue reading the learning paths to know more.
3+
.NET based applications are supported on both Linux and Windows on Arm. Continue reading the Learning Paths to discover more.
44
55
66
recommended_path: "/learning-paths/servers-and-cloud-computing/aks/"

content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/_review.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
review:
33
- questions:
44
question: >
5-
.NET based applications can be deployed on Azure Cobalt 100 Arm-based VMs.
5+
.NET based-applications can be deployed on Azure Cobalt 100 Arm-based VMs.
66
answers:
77
- "True"
88
- "False"
99
correct_answer: 1
1010
explanation: >
11-
Arm Neoverse based Azure Cobalt 100 VMs support .NET based applications.
11+
Arm Neoverse-based Azure Cobalt 100 VMs support .NET based applications.
1212
- questions:
1313
question: >
14-
What is the general purpose VM series supported by Azure Cobalt 100 processors?
14+
What is the general-purpose VM series supported by Azure Cobalt 100 processors?
1515
answers:
1616
- "Dpsv6"
1717
- "Epsv6"
1818
correct_answer: 1
1919
explanation: >
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.
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.
2121
- questions:
2222
question: >
2323
GitHub Actions does not support Arm-based runners.
@@ -26,7 +26,7 @@ review:
2626
- "False"
2727
correct_answer: 2
2828
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.
3030
3131
3232
# ================================================================================

content/learning-paths/servers-and-cloud-computing/azure-cobalt-cicd-aks/azure-cobalt.md

Lines changed: 75 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,96 @@
11
---
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"
33

4-
weight: 2
4+
weight: 3
55

66
layout: "learningpathall"
77
---
88

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

1311
{{% 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/).
1515
{{% /notice %}}
1616

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

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`.
2021

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

2324
![azure-cobalt-vm #center](_images/azure-cobalt-vm.png)
2425

25-
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?
2631

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

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:
3035

31-
Start by forking this repository.
36+
* Start by forking the repository.
3237

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

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

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 %}}
3851

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?
4053

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:
4257

4358
```console
4459
`vm_size` = `Standard_D2ps_v6`
4560
```
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.
4762

48-
## Create container registry with ACR
63+
## How do I create a container registry with Azure Container Registry (ACR)?
4964

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:
5166

5267
```console
5368
az acr create --resource-group myResourceGroup --name mycontainerregistry
5469
```
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.
5682

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
5884

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

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:
6588

66-
## Deploy a .NET based application
89+
* In your fork of the GitHub repository, inspect the `aks-ga-demo.csproj` file.
6790

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

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:
7194

7295
```console
7396
<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
82105

83106
You can inspect the contents of the `Dockerfile` within your repository as well. This is a multi-stage Dockerfile with the following stages:
84107

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

90116
```console
91117
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base
@@ -110,7 +136,7 @@ COPY --from=publish /app/publish .
110136
ENTRYPOINT ["dotnet", "aks-ga-demo.dll"]
111137
```
112138

113-
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.
114140

115141
```yaml
116142
apiVersion: apps/v1
@@ -153,7 +179,7 @@ spec:
153179
targetPort: 80
154180
```
155181

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`
157183

158184
```yaml
159185
name: Deploy .NET app
@@ -209,19 +235,21 @@ jobs:
209235
msbuilddemo.azurecr.io/githubactions-aks-demo:${{github.sha }}
210236
```
211237

212-
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:
213241

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

222-
## Run the CI/CD pipeline
250+
## How do I run the CI/CD pipeline?
223251

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:
225253

226254
![github-run #center](_images/github-run.png)
227255

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "Background"
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## 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).
21+

0 commit comments

Comments
 (0)