Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
aec4c02
Starting content review
madeline-underwood Jun 17, 2025
62f4e50
Further updates
madeline-underwood Jun 17, 2025
bb03034
Updates
madeline-underwood Jun 17, 2025
4470ad6
Updates
madeline-underwood Jun 17, 2025
cf1d862
Updates
madeline-underwood Jun 17, 2025
ce0babf
remove json file
madeline-underwood Jun 17, 2025
98570b8
Merge branch 'ArmDeveloperEcosystem:main' into NET-for-Cobalt
madeline-underwood Jun 18, 2025
0b1aa0f
Updated URL to .NET docs
madeline-underwood Jun 18, 2025
04d0e79
Merge branch 'NET-for-Cobalt' of https://github.com/madeline-underwoo…
madeline-underwood Jun 18, 2025
7d6e23e
Updates
madeline-underwood Jun 18, 2025
3653ad5
Improvements
madeline-underwood Jun 18, 2025
552d39b
Updates
madeline-underwood Jun 18, 2025
450b472
Merge branch 'ArmDeveloperEcosystem:main' into NET-for-Cobalt
madeline-underwood Jun 18, 2025
aed137e
Further enhancements
madeline-underwood Jun 18, 2025
c2f90ac
Merge branch 'NET-for-Cobalt' of https://github.com/madeline-underwoo…
madeline-underwood Jun 18, 2025
e4ce03d
Updates
madeline-underwood Jun 18, 2025
30ca2a8
Updates
madeline-underwood Jun 18, 2025
465d115
Merge branch 'ArmDeveloperEcosystem:main' into NET-for-Cobalt
madeline-underwood Jun 19, 2025
88033cb
Updates
madeline-underwood Jun 19, 2025
c2aa829
Merge branch 'NET-for-Cobalt' of https://github.com/madeline-underwoo…
madeline-underwood Jun 19, 2025
8a334c8
Updates
madeline-underwood Jun 19, 2025
4d88dde
Final tweaks
madeline-underwood Jun 19, 2025
c8028b3
Merge branch 'ArmDeveloperEcosystem:main' into NET-for-Cobalt
madeline-underwood Jun 20, 2025
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,25 +8,29 @@ layout: learningpathall

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

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.
Cobalt 100 is Microsoft’s first Arm-based server processor, built on the Armv9 Neoverse-N2 CPU architecture. It is optimized for the performance and efficiency of scale-out, cloud-based applications.

The Azure Cobalt 100 VM instances include two series:
Azure offers Cobalt 100–powered virtual machines in two series:

- **Dpsv6** and **Dplsv6** (general-purpose)
- **Epsv6** (memory-optimized)

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**.
3. Complete the *Basics* tab:
![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png)
The Dpsv6-series are powered by Cobalt 100. Selecting Standard_D4ps_v6 will give you a Cobalt VM with 4 physical cores. you can change the 4 to another value if you want a different number of cores.
3. Complete the fields in the **Basics** tab using the values shown in the figure below:

![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png "Configuring the Basics tab")

Cobalt 100 powers the Dpsv6 and Dplsv6 series. Selecting **Standard_D4ps_v6** creates a Cobalt VM with four physical cores.
You can choose a different size if you need more or fewer cores.
4. Upload your public SSH key or generate a new one in the wizard.
5. Disallow public inbound ports for now.
5. Accept the defaults on the *Disks* tab.
6. On the *Networking* tab ensure that a **Public IP** is selected. You will need it to connect later. Leave the NSG settings as *Basic* for now.
5. For the **Public inbound ports** field, select **None**.
6. On the **Disks** tab, accept the default options.
7. On the **Networking** tab, ensure that a **Public IP** is selected. You will need it to connect to the VM later. Leave the NSG settings as **Basic**.

Click **Review + create** followed by **Create**. Azure now deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.
8. Select **Review + create**, then **Create**. Azure deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.

Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment succeeds proceed to the next step to expose an inbound port.
9. Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment completes, proceed to the next step to expose an inbound port.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Open an inbound port in the Network Security Group
title: Open inbound ports in the Network Security Group
weight: 3

### FIXED, DO NOT MODIFY
Expand All @@ -8,16 +8,20 @@ layout: learningpathall

## Allow external traffic to TCP ports 22 (SSH) and 8080

Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts like a stateful firewall – if no rule explicitly allows traffic, Azure blocks it.
Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts as a stateful firewall – if no rule explicitly allows traffic, Azure blocks it by default.

In this step you will open port 22 for SSH, as well as port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.
In this step, you'll open port 22 for SSH and port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.

1. In the Azure Portal open the newly created VM resource and click **Networking → Network settings** in the left nav.
1. In the Azure Portal, open the newly-created VM resource and select **Networking → Network settings** from the left-hand menu.
2. Select the **Network security group**.
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.
3. Select **Create Port Rule**, then choose **Inbound port rule** from the drop-down menu.

You have now opened ports 22 and 8080 to your IP. In the next step you will verify connectivity.
4. Fill in the form with **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 "Create Port Rule form")

5. Select **Add**.

6. To open port 8080, repeat steps 3-5 and enter 8080 as the destination port.

You have now opened ports 22 and 8080 to your IP. In the next step, you'll verify connectivity from your local machine.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ layout: learningpathall

## Connect over SSH and test the open port

1. On the **Overview** page for the VM copy the **Public IP address**.
2. Open a terminal on your local machine and SSH to the VM (replace *azureuser* if you chose a different admin username):
On the **Overview** page of the VM, copy the **Public IP address**. Open a terminal on your local machine, and SSH to the VM (replace *azureuser* if you chose a different admin username):

```bash
ssh -i [path to your pem file] azureuser@[public IP]
```

Where `[public IP]` is your public IP and `[path to your pem file]` is the path to your SSH key file.
Replace `[public IP]` with your VM's public IP address, and `[path to your pem file]` with the path to your SSH private key file.

Accept the prompt to add the host to *known_hosts* the first time you connect.
When prompted, confirm the connection to add the VM to your *known_hosts* file.

### Start a simple HTTP server
### Start a temporary HTTP server

If you do not already have an application listening on TCP 8080 you can start one temporarily:
If you don't already have an application listening on TCP 8080, you can start one temporarily:

```bash
sudo apt update -y && sudo apt install -y python3
Expand All @@ -32,16 +31,18 @@ Leave this terminal open – the server runs in the foreground.

### Test from your local machine

In a second local terminal run `curl` to confirm you can reach the server through the NSG rule you created:
In a second local terminal run `curl` to confirm that you can reach the server through the NSG rule you created:

```bash
curl http://[public IP]:8080
```

Where `[public IP]` is your public IP.
Replace `[public IP]` with your VM's public IP address.

You should see an HTML directory listing (or your application response). Receiving a response verifies that TCP 8080 is open and the VM is reachable from the public internet.
You should see an HTML directory listing (or your application response). A successful response confirms that TCP port 8080 is open and the VM is reachable from the public internet.

Terminate the Python server when you are finished testing (press `Ctrl + C`).
To stop the server, press `Ctrl + C`.

You now have an Arm-based Cobalt 100 VM with an exposed port 8080 that you can use to run any test server. To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).
You now have an Arm-based Cobalt 100 VM with port 8080 open and ready to receive external traffic. You can use it to run any test server or deploy your own application.

To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Create an Azure Cobalt 100 VM
title: Deploy a Cobalt 100 Virtual Machine on Azure

minutes_to_complete: 10

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.
who_is_this_for: This is an introductory topic for developers and DevOps engineers who want to deploy an Arm-based virtual machine on Azure and expose an application port to the internet.

learning_objectives:
- Deploy an Arm-based Cobalt 100 virtual machine (VM) on Microsoft Azure.
- Connect to the Cobalt 100 VM using SSH.
- Open an inbound TCP port in the associated Network Security Group (NSG).
- Verify external connectivity to the newly opened port.
- Deploy an Arm-based Cobalt 100 virtual machine (VM) on Microsoft Azure
- Connect to the Cobalt 100 VM using SSH
- Configure an inbound TCP port in the associated Network Security Group (NSG)
- Verify external connectivity to the newly-opened port

prerequisites:
- A Microsoft Azure subscription with permission to create resources
- A Microsoft Azure subscription with permissions to create virtual machines and networking resources
- Basic familiarity with SSH

author: Joe Stech
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
---
title: Create a basic OrchardCore application
title: Build and run an OrchardCore CMS app on Azure Cobalt (Arm64)
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

# Create a basic OrchardCore application
## Getting started with the OrchardCore app

In this section, you will learn how to create and compile a basic [OrchardCore](https://github.com/OrchardCMS/OrchardCore) CMS application, as an example of a popular Linux-based .NET workload. OrchardCore is a modular and multi-tenant application framework built with ASP.NET Core, which can be used to create content-driven websites.
In this section, you'll build and run a basic [OrchardCore](https://github.com/OrchardCMS/OrchardCore) CMS application, which is a popular Linux-based .NET workload. OrchardCore is a modular and multi-tenant application framework built with ASP.NET Core, that's commonly used to create content-driven websites.

## Step 1: Set up your development environment
### Set up your development environment

1. Launch an Azure Cobalt instance running Ubuntu 24.04, and open port 8080 to the internet. For instructions on how to do this, see the [Create an Azure Cobalt 100 VM](../../cobalt) Learning Path.
First, launch an Azure Cobalt 100 instance (Arm-based VM) running Ubuntu 24.04, and open port 8080 to the internet.

2. **Install .NET SDK**:
For setup instructions, see the [Create an Azure Cobalt 100 VM](../../cobalt) Learning Path.

Next, install .NET SDK:

```bash
wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
Expand All @@ -23,35 +25,35 @@ sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
```

3. **Verify installations**:
Verify the installation:

```bash
dotnet --version
```

The output should look like:
You should then see output similar to:

```output
8.0.117
```

4. Install gcc for compiling your application:
Install gcc for compiling your application:

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

## Step 2: Install the OrchardCore Templates
### 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:
Install the OrchardCore templates:

```bash
dotnet new install OrchardCore.ProjectTemplates::2.1.7
```

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

The output will look like:
Expected output:

```output
Success: OrchardCore.ProjectTemplates::2.1.7 installed the following templates:
Expand All @@ -64,31 +66,31 @@ 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
### Create a new OrchardCore application

1. **Create a new project**: Use the `dotnet` CLI to create a new OrchardCore application.
First, create a new project using the `dotnet` CLI to create a new OrchardCore application:

```bash
dotnet new occms -n MyOrchardCoreApp
```

This command creates a new OrchardCore CMS application in a directory named `MyOrchardCoreApp`.
This command creates a new OrchardCore CMS application in a directory named `MyOrchardCoreApp`.

2. **Navigate to the project directory**:
Now navigate to the project directory:

```bash
cd MyOrchardCoreApp
```

## Step 4: Run the OrchardCore application
### Run the OrchardCore application

1. **Build the application**: Compile the application using the following command:
Build the application:

```bash
dotnet build
```

The output will look like:
The output should look like:

```output
MSBuild version 17.8.27+3ab07f0cf for .NET
Expand All @@ -103,14 +105,22 @@ Build succeeded.

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

```bash
dotnet run --urls http://0.0.0.0:8080
```

3. **Access the application**: Open a web browser and navigate to `http://[instance IP]:8080` to see your OrchardCore application in action, where `[instance IP]` is the public IP of your Azure Cobalt instance.
Access the application:

* In your browser, navigate to `http://[instance IP]:8080` to see your OrchardCore application in action.

* Replace `[instance IP]` with your VM’s public IP address. You can find it in the Azure portal under the **Networking** tab of your virtual machine.

Configure the application:

* On the setup screen, choose the Blog recipe and complete the admin credentials and database configuration to finish setup.

4. **Configure the application as a blog** In the resulting configuration page,
### Summary and next steps

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
@@ -1,21 +1,21 @@
---
title: Add a simple C shared library to your .NET OrchardCore application
title: Integrate a C shared library into your .NET OrchardCore app
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---
## Create a C shared library

## Introduction
In this section, you’ll integrate a simple C shared library into your .NET OrchardCore application, by doing the following:

In this section, you will learn how to integrate a simple C shared library into your .NET OrchardCore application. This process involves creating a C library, compiling it, and then using it within your .NET application. This integration can help you leverage existing C code and libraries, enhancing the functionality and performance of your application.
- Write a C function
- Compile it into a shared object (`.so`)
- Call it from C# using `DllImport`

This allows you to reuse existing C code and improve performance by accessing native functionality.

## Step 1: Create a C shared library

First, you need to create a simple C shared library. This library will contain a function that you will call from your .NET application.

1. Create a new file named `mylib.c` with the following content:
Create a file named `mylib.c` with the following:

```c
#include <stdio.h>
Expand All @@ -25,19 +25,19 @@ void greet() {
}
```

2. Compile the C file into a shared library:
Compile the C file into a shared library:

```bash
gcc -shared -o libmylib.so -fPIC mylib.c
```

This will generate a shared library file (`libmylib.so`).
This creates a shared object file named `libmylib.so` which your .NET application can call at runtime.

## Step 2: Use the C library in your .NET application
## Use the C library in your .NET application

Now that you have a shared library, you can use it in your .NET application.

1. In your OrchardCore application, create a new class file named `NativeMethods.cs`:
In your OrchardCore application, create a new class file named `NativeMethods.cs`:

```csharp
using System;
Expand All @@ -49,8 +49,11 @@ public static class NativeMethods
public static extern void Greet();
}
```
{{% notice Note %}}
On Linux, the `DllImport("mylib")` attribute resolves to `libmylib.so`. On Windows, the runtime would look for `mylib.dll`, and on macOS, `libmylib.dylib`.
{{% /notice %}}

2. Call the `Greet` method from your application. For example, you can add the following code to your main program `Program.cs` as shown:
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 Expand Up @@ -88,31 +91,29 @@ app.UseOrchardCore();
app.Run();
```

3. Ensure that dotnet can find your shared library:
Ensure that dotnet can find your shared library:

```bash
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH
```

## Step 3: Run your application
## Run your application

Now when you run `dotnet run`, you will see
When you run `dotnet run`, you’ll see the following output:

```bash
Calling native greet...
Hello from the C library!
```

in the logging output.

## Compiling for Arm

If you are compiling for Arm directly on Azure Cobalt, the compiler understands what default processor optimizations it should use, and you can compile as done in Step 1 above. However, if you are cross-compiling in your build pipeline, you should specify `-mcpu=neoverse-n2 -O3` when running the cross-compiler:
If you are compiling for Arm directly on Azure Cobalt, the compiler understands what default processor optimizations it should use, and you can compile as done above. However, if you are cross-compiling in your build pipeline, you should specify `-mcpu=neoverse-n2 -O3` when running the cross-compiler:

```bash
aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -O3 -shared -o libmylib.so -fPIC mylib.c
```

The `-mcpu=neoverse-n2` flag specifies the Cobalt architecture, and `-O3` ensures that maximum optimizations are completed (including SIMD opimizations).
The `-mcpu=neoverse-n2` flag specifies the Cobalt architecture, and `-O3` ensures that maximum optimizations are completed (including SIMD optimizations).

In the next section, you will explore how to make your build architecture agnostic with the anyCPU feature.
In the next section, you’ll make your native interop cross-platform by using the AnyCPU feature and runtime dispatch strategies.
Loading