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/net-aspire/_index.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,26 @@
1
1
---
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
3
3
4
4
minutes_to_complete: 60
5
5
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).
7
7
8
8
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.
12
13
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 [Armbased 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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/net-aspire/_review.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ review:
4
4
question: >
5
5
Which command do you use to install the Aspire workload on an Arm-powered VM?
6
6
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.
10
10
correct_answer: 2
11
11
explanation: >
12
12
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:
15
15
question: >
16
16
When creating an AWS EC2 instance, which step ensures secure remote access to the VM?
17
17
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.
21
21
correct_answer: 1
22
22
explanation: >
23
23
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.
24
24
25
25
- questions:
26
26
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?
28
28
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).
32
32
correct_answer: 1
33
33
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.
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).
11
14
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.
16
16
17
-

17
+
As Figure 5 shows, in the search box, type "EC2".
18
+
19
+
Then, click on **EC2** in the search results:
18
20
19
-
3. In the EC2 Dashboard, click “Launch Instance” and fill out the following details:
The configuration should look like the configuration fields that Figure 6 shows:
28
30
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
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.
34
40
35
41

36
42
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.
45
51
46
52

47
53
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.
54
61
55
-
The configuration should look as follows:
62
+
The configuration should look like:
56
63
57
64

58
65
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:
60
69
61
70

62
71
63
72
### 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
+
66
77
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:
@@ -106,20 +117,20 @@ Trust the development certificate:
106
117
```console
107
118
dotnet dev-certs https --trust
108
119
```
109
-
Build and run the project
120
+
Build and run the project:
110
121
```console
111
122
dotnet restore
112
123
dotnet run --project NetAspire.Arm.AppHost
113
124
```
114
125
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:
116
127
117
128

118
129
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:
120
131
121
132

122
133
123
134
### 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.
.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.
11
11
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:
13
13
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.
15
17
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.
17
19
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:
19
21
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.
21
25
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:
0 commit comments