Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ layout: learningpathall

## Use the Azure Portal to deploy a Cobalt 100 VM

Azure Cobalt 100 VMs are a part of the ['D' family of Azure VMs](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/d-family). To deploy one, follow these steps:
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 two series:

The general-purpose Dpsv6 and Dplsv6 virtual machine series.
The memory-optimized Epsv6 virtual machine series.

To create a Cobalt 100 VM, follow these steps:

1. Sign in to the [Azure Portal](https://portal.azure.com/).
2. Select **Create a resource → Compute → Virtual machine**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ In this step you will open port 22 for SSH, as well as port 8080 so that a web a

1. In the Azure Portal open the newly created VM resource and click **Networking → Network settings** in the left nav.
2. Select the **Network security group**.
3. In the left nav click **Settings → Inbound security rules**
4. Click **Add** at the top of the screen.
5. Fill in the form, specifying **My IP address** as the source and 22 as the destination port:
3. Click on **Create Port Rule** and from the drop-down men select **Inbound port rule**
4. Fill in the form, specifying **My IP address** as the source and 22 as the destination port:
![Add inbound security rule with source of my IP and destination port 22#center](images/create-nsg-rule.png)
5. Click **Add**.
To open port 8080, follow steps 3 through 5 again, but instead choose port 8080 for the destination port.

To open port 8080, follow steps 4 and 5 again, but instead choose port 8080 for the destination port.

You have now opened ports 22 and 8080 to your IP. In the next step you will verify connectivity.
You have now opened ports 22 and 8080 to your IP. In the next step you will verify connectivity.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Create an Azure Cobalt 100 VM

minutes_to_complete: 10

who_is_this_for: Developers and DevOps engineers who need an Arm-based virtual machine on Azure and want to expose an application port to the internet.
who_is_this_for: This is an introductory topic for developers and DevOps engineers who need an Arm-based virtual machine on Azure and want to expose an application port to the internet.

learning_objectives:
- Deploy an Arm-based Cobalt 100 virtual machine (VM) on Microsoft Azure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ sudo apt-get install -y dotnet-sdk-8.0
dotnet --version
```

The output should look like:

```output
8.0.117
```

4. Install gcc for compiling your application:

```bash
sudo apt install gcc g++ build-essential -y
```

## Step 2: Install the OrchardCore Templates

To start building an OrchardCore application, you need to install the OrchardCore templates. Open your terminal and run the following command:
Expand All @@ -39,6 +51,19 @@ dotnet new install OrchardCore.ProjectTemplates::2.1.7

This command installs the OrchardCore project templates, which you will use to create a new application.

The output will look like:

```output
Success: OrchardCore.ProjectTemplates::2.1.7 installed the following templates:
Template Name Short Name Language Tags
------------------------ ----------- -------- --------------------
Orchard Core Cms Module ocmodulecms [C#] Web/Orchard Core/CMS
Orchard Core Cms Web App occms [C#] Web/Orchard Core/CMS
Orchard Core Mvc Module ocmodulemvc [C#] Web/Orchard Core/Mvc
Orchard Core Mvc Web App ocmvc [C#] Web/Orchard Core/Mvc
Orchard Core Theme octheme [C#] Web/Orchard Core/CMS
```

## Step 3: Create a new OrchardCore application

1. **Create a new project**: Use the `dotnet` CLI to create a new OrchardCore application.
Expand All @@ -63,6 +88,21 @@ cd MyOrchardCoreApp
dotnet build
```

The output will look like:

```output
MSBuild version 17.8.27+3ab07f0cf for .NET
Determining projects to restore...
Restored /home/azureuser/MyOrchardCoreApp/MyOrchardCoreApp.csproj (in 28.95 sec).
MyOrchardCoreApp -> /home/azureuser/MyOrchardCoreApp/bin/Debug/net8.0/MyOrchardCoreApp.dll
Copying translation files: MyOrchardCoreApp

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:38.05
```
2. **Run the application**: Start the application with:

```bash
Expand All @@ -73,4 +113,4 @@ dotnet run --urls http://0.0.0.0:8080

4. **Configure the application as a blog** In the resulting configuration page,

You have successfully created and run a basic OrchardCore CMS application. In the next sections, you will learn how to integrate a C shared library into your .NET application and explore performance optimizations for Arm architecture.
You have successfully created and run a basic OrchardCore CMS application. In the next sections, you will learn how to integrate a C shared library into your .NET application and explore performance optimizations for Arm architecture.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static class NativeMethods
}
```

2. Call the `Greet` method from your application. For example, you can add the following code to your main program or a controller:
2. Call the `Greet` method from your application. For example, you can add the following code to your main program `Program.cs` as shown:

```csharp
using OrchardCore.Logging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ The AnyCPU feature has been around since .NET 2, but it's current incarnation wa

To make your OrchardCore application architecture agnostic, you need to configure it to use the AnyCPU platform target. This allows the .NET runtime to choose the appropriate architecture at runtime.

1. Open your OrchardCore project in your preferred IDE.
2. Locate the `.csproj` file for your project.
3. Modify the `<PlatformTarget>` element to `AnyCPU`:
1. Open your OrchardCore project `MyOrchardCoreApp.csproj` in your preferred IDE.
2. Find the `<PropertyGroup>` and add the `<PlatformTarget>` element to `AnyCPU`:

```xml
<PropertyGroup>
Expand All @@ -30,6 +29,8 @@ To make your OrchardCore application architecture agnostic, you need to configur

## Build once, run anywhere

You can now build your application on either an x86 or Arm host machine and deploy it on any architecture.

```bash
dotnet build -c Release
```
Expand All @@ -40,14 +41,12 @@ dotnet build -c Release
dotnet run --urls http://0.0.0.0:8080
```

Your application should now be runnable on any architecture. All you have to do is copy the `MyOrchardCoreApp` directory to any computer with the .NET 8 Framework installed and run
Your application should now be runnable on any architecture. All you have to do is copy the `MyOrchardCoreApp` directory to any computer with the .NET 8 Framework installed and run the command shown from within the `MyOrchardCoreApp` directory:

```bash
dotnet ./bin/Release/net8.0/MyOrchardCoreApp.dll --urls http://0.0.0.0:8080
```

From within the `MyOrchardCoreApp` directory.

## Benefits of architecture agnostic applications

By configuring your application to be architecture agnostic, you gain several benefits:
Expand All @@ -56,4 +55,4 @@ By configuring your application to be architecture agnostic, you gain several be
- **Efficiency**: Reduce the need for maintaining separate builds for different architectures.
- **Scalability**: Easily scale your application across different hardware platforms.

This approach ensures that your OrchardCore application can run seamlessly on both Arm and x86 architectures.
This approach ensures that your OrchardCore application can run seamlessly on both Arm and x86 architectures.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layout: learningpathall

Understanding which versions perform best and the features they offer can help you make informed decisions when developing applications for Arm-based systems.

.NET has evolved significantly over the years, with each version introducing new features and performance improvements. Here, we will focus on the key versions that have notable performance implications for Arm architecture.
.NET has evolved significantly over the years, with each version introducing new features and performance improvements. Here, you will learn about key versions that have notable performance implications for Arm architecture.

## .NET Core 3.1 (end-of-life 2022)

Expand Down Expand Up @@ -68,7 +68,7 @@ Although .NET 9 will receive only 18 months of support, it is an excellent choic

.NET 10 is still in preview and will likely change prior to it's GA release, but it will be the next LTS version of .NET.

- Extended SVE2 and new SME (Scalable Matrix Extension) intrinsics to unlock efficient implementation of large-scale numerical algorithms and on-device AI inference on Arm v9.
- [Extended SVE2 intrinsics](https://github.com/dotnet/runtime/issues/109652) to unlock efficient implementation of large-scale numerical algorithms and on-device AI inference on Arm v9.
- C# 14 is expected to ship alongside .NET 10, bringing additional compile-time metaprogramming features that can reduce boilerplate on resource-constrained Arm edge devices.

Because .NET 10 is still in preview, you should validate any assumptions about feature availability against the latest preview builds and roadmap updates.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
---
title: Migrating a .NET application to Azure Cobalt
title: Migrate a .NET application to Microsoft Azure Cobalt 100

minutes_to_complete: 25

who_is_this_for: .NET developers who want to take advantage of the cost and performance benefits of Azure Cobalt processors.
who_is_this_for: This is an advanced learning path for .NET developers who want to take advantage of the cost and performance benefits of Azure Cobalt processors.

learning_objectives:
- Create and compile a basic OrchardCore CMS application
- Add a simple C shared library to your .NET application
- Learn about anyCPU hardware agnostic builds
- Gain intuition about performance of different .NET versions
- Learn about performance of different .NET versions

prerequisites:
- An Azure account
- Installation of .NET 8
- gcc installed
- A Microsoft Azure account

author: Joe Stech

Expand Down