Skip to content

Commit 24a9e47

Browse files
Merge pull request #1480 from madeline-underwood/NET-ASPIRE
.NET Aspire_KB approved
2 parents ebe6bbf + e62d510 commit 24a9e47

File tree

8 files changed

+334
-236
lines changed

8 files changed

+334
-236
lines changed

content/learning-paths/servers-and-cloud-computing/net-aspire/_index.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
2-
title: Run .NET Aspire applications on Arm-based Virtual Machines in AWS and GCP
2+
title: Run a .NET Aspire application on Arm-based VMs on AWS and GCP
33

44
minutes_to_complete: 60
55

6-
who_is_this_for: This is an introductory learning path for software developers interested in learning how to deploy .NET Aspire applications in AWS and GCP
6+
who_is_this_for: This is an introductory topic for software developers interested in learning how to deploy .NET Aspire applications on Arm-based virtual machines (VMs) on Amazon Web Services (AWS) and Google Cloud Platform (GCP).
77

88
learning_objectives:
9-
- Learn about .NET Aspire.
10-
- Create a .NET Aspire project and deploy it to the Arm-powered Virtual Machines in the Cloud.
11-
9+
- Demonstrate knowledge and understanding of .NET Aspire developer tools.
10+
- Create a .NET Aspire application.
11+
- Modify code on a Windows on Arm development machine.
12+
- Deploy a .NET Aspire application to Arm-powered virtual machines in the Cloud.
1213
prerequisites:
13-
- A Windows on Arm computer such as [Windows Dev Kit 2023](https://learn.microsoft.com/en-us/windows/arm/dev-kit), a Lenovo Thinkpad X13s running Windows 11 to build the .NET Aspire project.
14-
- An [Arm based instance](/learning-paths/servers-and-cloud-computing/csp/) from AWS or GCP to deploy the application.
15-
- Any code editor. [Visual Studio Code for Arm64](https://code.visualstudio.com/docs/?dv=win32arm64user) is suitable.
14+
- A Windows on Arm machine, for example the [Windows Dev Kit 2023](https://learn.microsoft.com/en-us/windows/arm/dev-kit), or a Lenovo Thinkpad X13s running Windows 11 to build the .NET Aspire project.
15+
- An [Arm-based instance](/learning-paths/servers-and-cloud-computing/csp/) from AWS or GCP.
16+
- Any code editor. [Visual Studio Code for Arm64](https://code.visualstudio.com/docs/?dv=win32arm64user) is an example of a suitable editor.
1617

1718
author_primary: Dawid Borycki
1819

1920
### Tags
2021
skilllevels: Introductory
2122
subjects: Containers and Virtualization
22-
cloud_service_providers: AWS, Google Cloud
23+
cloud_service_providers: AWS, Google Cloud
2324

2425
armips:
2526
- Neoverse

content/learning-paths/servers-and-cloud-computing/net-aspire/_review.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ review:
44
question: >
55
Which command do you use to install the Aspire workload on an Arm-powered VM?
66
answers:
7-
- sudo apt install aspire
8-
- dotnet workload install aspire
9-
- dotnet install aspire --arm64
7+
- sudo apt install aspire.
8+
- dotnet workload install aspire.
9+
- dotnet install aspire --arm64.
1010
correct_answer: 2
1111
explanation: >
1212
The correct command to install the Aspire workload is `dotnet workload install aspire`, as it uses the .NET CLI to manage workloads.
@@ -15,23 +15,23 @@ review:
1515
question: >
1616
When creating an AWS EC2 instance, which step ensures secure remote access to the VM?
1717
answers:
18-
- Creating a new key pair in the "Key pair (login)" section
19-
- Selecting the appropriate security group for the instance
20-
- Allowing HTTP and HTTPS traffic in the network settings
18+
- Creating a new key pair in the "Key pair (login)" section.
19+
- Selecting the appropriate security group for the instance.
20+
- Allowing HTTP and HTTPS traffic in the network settings.
2121
correct_answer: 1
2222
explanation: >
2323
Creating a new key pair in the "Key pair (login)" section generates a private key file that is essential for secure SSH access to the EC2 instance.
2424
2525
- questions:
2626
question: >
27-
In Google Cloud Platform, what series should you select to use an Arm64 processor for your VM?
27+
In Google Cloud Platform, which series should you select to use an Arm64 processor for the VM?
2828
answers:
29-
- T2A (Ampere Altra Arm)
30-
- E2 (General Purpose)
31-
- N2D (Compute Optimized)
29+
- T2A (Ampere Altra Arm).
30+
- E2 (General Purpose).
31+
- N2D (Compute Optimized).
3232
correct_answer: 1
3333
explanation: >
34-
The T2A series (Ampere Altra Arm) is designed specifically for Arm64 processors and provides cost-effective, high-performance computing in GCP.
34+
The T2A series (Ampere Altra Arm) is designed specifically for Arm64 processors and provides cost-effective, high-performance computing in the Google Cloud Platform.
3535
3636
# ================================================================================
3737
# FIXED, DO NOT MODIFY
Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,96 @@
11
---
22
title: Deploy to AWS EC2
3-
weight: 4
3+
weight: 6
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
8-
98
### Objective
10-
In this section you will learn how to deploy the .NET Aspire application onto an AWS EC2 Virtual Machine powered by Arm-based processors, such as AWS Graviton. This involves leveraging the cost and performance benefits of Arm architecture while demonstrating the seamless deployment of cloud-native applications on modern infrastructure.
9+
In this section, you will learn how to deploy the .NET Aspire application you created on to an AWS Elastic Compute Cloud (EC2) virtual machine powered by Arm-based processors, such as AWS Graviton. This allows you to leverage the cost and performance benefits of Arm architecture while benefiting from the seamless deployment of cloud-native applications on modern infrastructure.
10+
11+
### Set up your AWS EC2 Instance
12+
To set up an Arm-powered EC2 instance, follow these steps:
13+
1. Log in to the [AWS Management Console](http://console.aws.amazon.com).
1114

12-
### Setup your AWS EC2 Instance
13-
Follow these steps to deploy an app to an Arm-powered EC2 instance::
14-
1. Log in to AWS Management Console [here](http://console.aws.amazon.com)
15-
2. Navigate to EC2 Service. In the search box type "EC2". Then, click EC2:
15+
2. Navigate to the EC2 Service.
1616

17-
![fig5](figures/05.png)
17+
As Figure 5 shows, in the search box, type "EC2".
18+
19+
Then, click on **EC2** in the search results:
1820

19-
3. In the EC2 Dashboard, click “Launch Instance” and fill out the following details:
20-
* Name: type arm-server
21-
* AMI: Select Arm-compatible Amazon Machine Image, Ubuntu 22.04 LTS for Arm64.
22-
* Architecture: Select 64-bit (Arm).
23-
* Instance Type: Select t4g.small.
21+
![Figure 5 alt-text#center](figures/05.png "Figure 5: Search for the EC2 Service in the AWS Management Console.")
2422

25-
The configuration should look as follows:
23+
3. In the EC2 Dashboard, click **Launch Instance** and add the following information in these corresponding data fields to configure your setup:
24+
* Name: enter **arm-server**.
25+
* AMI: select **Arm-compatible Amazon Machine Image, Ubuntu 22.04 LTS for Arm64**.
26+
* Architecture: select **64-bit (Arm)**.
27+
* Instance Type: select **t4g.small**.
2628

27-
![fig6](figures/06.png)
29+
The configuration should look like the configuration fields that Figure 6 shows:
2830

29-
4. Scroll down to "Key pair (login)", and click "Create new key pair". This will display the "Create key pair" window, in which you configure the following:
30-
* Key pair name: arm-key-pair
31-
* Key pair type: RSA
32-
* Private key format: .pem
33-
* Click the Create key pair button, and download the key pair to your computer
31+
![Figure 6 alt-text#center](figures/06.png "Figure 6: Configuration Fields.")
32+
33+
4. Scroll down to **Key pair** (login), and click **Create new key pair**.
34+
This displays the **Create key pair** window.
35+
Now configure the following fields:
36+
* Key pair name: **arm-key-pair**.
37+
* Key pair type: **RSA**.
38+
* Private key format: **.pem**.
39+
* Click the **Create key pair** button, and download the key pair to your computer.
3440

3541
![fig7](figures/07.png)
3642

37-
5. Scroll down to "Network Settings", where:
38-
* VPC: use default
39-
* Subnet: select no preference
40-
* Auto-assign public IP: Enable
41-
* Firewall: Check Create security group
42-
* Security group name: arm-security-group
43-
* Description: arm-security-group
44-
* Inbound security groups
43+
5. Scroll down to **Network Settings**, and configure the settings:
44+
* VPC: select the default.
45+
* Subnet: select **No preference**.
46+
* Auto-assign public IP: **Enable**.
47+
* Firewall: Check **Create security group**.
48+
* Security group name: **arm-security-group**.
49+
* Description: **arm-security-group**.
50+
* Inbound security groups.
4551

4652
![fig8](figures/08.png)
4753

48-
6. Configure "Inbound Security Group Rules". Specifically, click "Add Rule" and set the following details:
49-
* Type: Custom TCP
50-
* Protocol: TCP
51-
* Port Range: 7133.
52-
* Source: Select Anywhere (0.0.0.0/0) for public access or restrict access to your specific IP for better security.
53-
* Repeat this step for all three ports the application is using. Here I have 7133, 7511, 17222. These must match the values we had, when we run the app locally.
54+
6. Configure **Inbound Security Group Rules** by selecting **Add Rule** and then setting the following details:
55+
* Type: **Custom TCP**.
56+
* Protocol: **TCP**.
57+
* Port Range: **7133**.
58+
* Source: Select **Anywhere (0.0.0.0/0)** for public access or restrict access to your specific IP for better security.
59+
60+
Repeat this step for all three ports that the application is using. This example demonstrates setup using ports 7133, 7511, and 17222. These must match the values that you have when you run the app locally.
5461

55-
The configuration should look as follows:
62+
The configuration should look like:
5663

5764
![fig9](figures/09.png)
5865

59-
7. Launch an instance by clicking "Launch instance" button. You should see the green box with the Success label. This box also contains a link to the EC2 instance. Click it. It will take you to the instance dashboard, which looks like the one below:
66+
7. Launch an instance by clicking the **Launch instance** button. You should see the green box with the **Success** label.
67+
68+
This box also contains a link to the EC2 instance. Click on it, and it takes you to the instance dashboard, as Figure 10 shows:
6069

6170
![fig10](figures/10.png)
6271

6372
### Deploy the application
64-
Once the EC2 instance is ready, you can connect to it and deploy the application. Follow these steps to connect:
65-
1. Locate the instance public IP (e.g. 98.83.137.101 in this case).
73+
Once the EC2 instance is ready, you can connect to it, and deploy the application. Follow these steps to connect:
74+
75+
1. Locate the instance public IP (here this is 98.83.137.101).
76+
6677
2. Use an SSH client to connect:
67-
* Open the terminal
68-
* Set appropriate permissions for the key pair file (remember to use your IP address)
78+
* Open the terminal.
79+
* Set the appropriate permissions for the key pair file, using your own IP address:
6980
```console
7081
chmod 400 arm-key-pair.pem
7182
ssh -i arm-key-pair.pem [email protected]
7283
```
7384

7485
![fig11](figures/11.png)
7586

76-
You can now install required components, pull the application code from git, and launch the app:
87+
You can now install the required components, pull the application code from git, and launch the app:
7788
In the EC2 terminal run:
7889
```console
7990
sudo apt update && sudo apt upgrade -y
8091
```
8192

82-
This will update the package list and upgrade the installed packages.
93+
This updates the package list and upgrades the installed packages.
8394

8495
Install .NET SDK using the following commands:
8596
```console
@@ -93,11 +104,11 @@ Verify the installation:
93104
```console
94105
dotnet --version
95106
```
96-
Install the Aspire workload using the dotnet CLI
107+
Install the Aspire workload using the dotnet CLI:
97108
```console
98109
dotnet workload install aspire
99110
```
100-
Clone the repository which contains the application you created in the previous section:
111+
Clone the repository that contains the application that you created in the previous section:
101112
```console
102113
git clone https://github.com/dawidborycki/NetAspire.Arm.git
103114
cd NetAspire.Arm/
@@ -106,20 +117,20 @@ Trust the development certificate:
106117
```console
107118
dotnet dev-certs https --trust
108119
```
109-
Build and run the project
120+
Build and run the project:
110121
```console
111122
dotnet restore
112123
dotnet run --project NetAspire.Arm.AppHost
113124
```
114125

115-
The application will run the same way as locally. You should see the following:
126+
The application runs the same way as it does locally. You should see the following:
116127

117128
![fig12](figures/12.png)
118129

119-
Finally, open the application in the web browser (using the EC2's public IP):
130+
Finally, open the application in the web browser, using the EC2's public IP:
120131

121132
![fig13](figures/13.png)
122133

123134
### Summary
124-
You have successfully deployed the Aspire app onto an Arm-powered AWS EC2 instance. This demonstrates the compatibility of .NET applications with Arm architecture and AWS Graviton instances, offering high performance and cost-efficiency.
135+
You have successfully deployed the Aspire app on to an Arm-powered AWS EC2 instance. This demonstrates the compatibility of .NET applications with Arm architecture and AWS Graviton instances, offering high performance and cost-efficiency.
125136

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
---
2-
title: Background
2+
title: .NET Aspire
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
### What is the .NET Aspire
10-
.NET Aspire is a comprehensive suite of powerful tools, templates, and packages designed to simplify the development of cloud-native applications using the .NET platform. Delivered through a collection of NuGet packages, .NET Aspire addresses specific cloud-native concerns, enabling developers to build observable and production-ready apps efficiently.
9+
### What is .NET Aspire?
10+
.NET Aspire is a comprehensive suite of powerful tools, templates, and packages designed to simplify the development of cloud-native applications using the .NET platform. Delivered through a collection of NuGet packages, .NET Aspire provides solutions for building cloud-native apps, enabling developers to build observable and production-ready projects efficiently.
1111

12-
Cloud-native applications are typically composed of small, interconnected services or microservices rather than a single monolithic codebase. These applications often consume a variety of services such as databases, messaging systems, and caching mechanisms. With .NET Aspire you get a consistent set of tools and patterns that help you build and run distributed applications, taking full advantage of the scalability, resilience, and manageability of cloud infrastructures.
12+
Cloud-native applications are typically composed of small, interconnected services or microservices, rather than a single monolithic codebase. These applications often consume a variety of services such as:
1313

14-
.NET Aspire enhances the local development experience by simplifying the management of your application's configuration and interconnections. It abstracts low-level implementation details, streamlining the setup of service discovery, environment variables, and container configurations. Specifically, with a few helper method calls, you can create local resources (like a Redis container), wait for them to become available, and configure appropriate connection strings in your projects.
14+
* Databases.
15+
* Messaging systems.
16+
* Caching mechanisms.
1517

16-
.NET Aspire offers integrations for popular services like Redis and PostgreSQL, ensuring standardized interfaces and seamless connections with your app. These integrations handle cloud-native concerns such as health checks and telemetry through consistent configuration patterns. By referencing named resources, configurations are injected automatically, simplifying the process of connecting services.
18+
.NET Aspire gives you a consistent set of tools and patterns that help you to build and run distributed applications, taking full advantage of the scalability, resilience, and manageability of cloud infrastructures.
1719

18-
.NET Aspire provides project templates that include boilerplate code and configurations common to cloud-native apps, such as telemetry, health checks, and service discovery. It offers tooling experiences for Visual Studio, Visual Studio Code, and the .NET CLI to help you create and interact with .NET Aspire projects. The templates come with defaults to help you get started quickly, reducing setup time and increasing productivity.
20+
.NET Aspire enhances the local development experience by simplifying the management of your application's configuration and interconnections. It abstracts low-level implementation details, and streamlines the following:
1921

20-
By providing a consistent set of tools and patterns, .NET Aspire streamlines the development process of cloud-native applications. It manages complex applications during the development phase without dealing with low-level implementation details. .NET Aspire easily connects to commonly used services with standardized interfaces and configurations. There are also various templates and tooling to accelerate project setup and development cycles. Finally, with .NET Aspire, you can create applications that are ready for production with built-in support for telemetry, health checks, and service discovery.
22+
* The setup of service discovery.
23+
* Environment variables.
24+
* Container configurations.
2125

22-
In this Learning Path, you will learn how to create a .NET Aspire application, describe the project, and modify the code on a Windows on Arm development machine. You will then deploy the application to AWS and GCP Arm-powered virtual machines.
26+
With a few helper method calls, you can create local resources, wait for the resources to become available, and then configure appropriate connection strings in your projects.
27+
28+
.NET Aspire offers integrations for popular services like Redis and PostgreSQL, ensuring standardized interfaces and seamless connections with your app. These integrations handle specific cloud-native requirements through consistent configuration patterns. By referencing named resources, configurations are injected automatically, simplifying the process of connecting services.
29+
30+
.NET Aspire provides project templates that include boilerplate code and configurations common to cloud-native apps, such as health checks and telemetry, as well as service discovery. It offers tooling experiences for Visual Studio, Visual Studio Code, and .NET CLI to help you create and interact with .NET Aspire projects. The templates come with default settings that you can use to get started quickly, which reduces setup time and increases productivity.
31+
32+
By providing a consistent set of tools and patterns, .NET Aspire streamlines the development process of cloud-native applications. It manages complex applications during the development phase without dealing with low-level implementation details. .NET Aspire easily connects to commonly-used services with standardized interfaces and configurations. There are also various templates and tooling to accelerate project setup and development cycles.
33+
34+
In this Learning Path, you will learn how to create a .NET Aspire application, describe the project, and modify the code on a Windows on Arm development machine. You will then deploy the application:
35+
36+
* Firstly, to an AWS Arm-powered virtual machine.
37+
* Secondly, to a GCP Arm-powered virtual machine.

0 commit comments

Comments
 (0)