# Getting Started with Microsoft Azure

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/)
- [Getting Started with AWS](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/aws/)
- [Getting Started with Microsoft Azure](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/azure/)
- [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/)
- [Getting Started with Oracle OCI](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/oci/)
- [Getting Started with Alibaba Cloud Services](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/alibaba/)
- [Next Steps](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/_next-steps/)

<a href="https://azure.microsoft.com/">Microsoft Azure</a> is a public cloud computing platform. As with most cloud service providers, Azure offers a pay-as-you-use <a href="https://azure.microsoft.com/en-us/pricing/">pricing policy</a>, including a number of <a href="https://azure.microsoft.com/en-us/free/">free</a> services. This guide is to help you get started with <a href="https://azure.microsoft.com/en-us/products/virtual-machines/">Virtual Machines</a>, using Arm-based VMs available in Azure. Microsoft Azure offers two generations of Arm-based VMs. The latest generation is based on <a href="https://azure.microsoft.com/en-us/blog/azure-cobalt-100-based-virtual-machines-are-now-generally-available/">Azure Cobalt 100 processors</a>. The previous generation VMs are based on <a href="https://azure.microsoft.com/en-us/blog/azure-virtual-machines-with-ampere-altra-arm-based-processors-generally-available/">Ampere</a> processors. This is a general-purpose compute platform, essentially your own personal computer in the cloud.

Full <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/">documentation and quickstart guides</a> are available.

## Create an account

Before you begin, create an account. For a personal account, click on `Free account` or `Try Azure for free` on the <a href="https://azure.microsoft.com">Azure homepage</a>, and follow the on-screen instructions to log in or register as a new user. You can use an existing Microsoft account if you have one. If using an organization’s account, you will likely need to consult with your internal administrator. Once logged in, you will be presented with the <a href="https://portal.azure.com">Azure portal</a>.

## Create your Virtual Machine (VM) instance

Locate <a href="https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Compute%2FVirtualMachines">Virtual Machines</a> from the list of `Azure Services`, then click `Create` > `Azure virtual machine`. You will be presented with the `Create a virtual machine` dialog.

![Create an Azure virtual machine](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/0d7dbd32-3ea2-4b5a-9886-2218ca78cc8a)

## Project details

This section is used to separate instances, usually for internal budgeting or access permissions. If a `Resource group` to contain your VMs does not yet exist, click on `Create new`. If you do not create a group, a new one will automatically be created based on your first VM name.

![Select or create a Resource group](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/f15a254d-4c32-4541-8c7c-110d0c3742d7)

## Instance details

This section defines key configuration details of the virtual machine.

### Virtual machine name

Give your virtual machine (VM) a meaningful, but arbitrary name. This is especially useful if you intend to create multiple VMs.

![Specify a name for the virtual machine](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/52fc152b-6c28-4164-8b09-352a203f2c17)

### Region

This is the location of the server where your VM will reside. While it is generally recommended to select a region closest to your location, not all regions may support Arm-based servers. You may need to change region to get access to such a server.

![Select an appropriate region](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/f51d05ee-217e-4f48-b94a-d4248cae0fd5)

### Availability options / Security type

These are reliability and security settings. They can generally be left as default.

![Select Availability options and Security type if necessary](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/f51d05ee-217e-4f48-b94a-d4248cae0fd5)

### Image

This is the operating system that will run on your VM. Select the appropriate one from the pull-down. Some will have additional pricing associated with them.

![Select an image available for Arm VMs](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/49e9bf84-9ab4-4b61-a122-13e133bc59cb)

You can then select a particular version of your preferred OS from the `Select` pull-down of that OS tab.

![Select an image version](https://user-images.githubusercontent.com/97123064/243473546-360f8003-0f43-4dda-871c-b4b31a29330d.png)

Note that if a `Windows` operating system is selected, the user must have an appropriate license. See the <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/windows/windows-desktop-multitenant-hosting-deployment">Azure documentation</a> for information.

### VM architecture

If not enabled automatically based on the above image, select `Arm64` for an Arm-based operating system. This will update the `Size` pull-down (see below) to present Arm-based servers.

![Choose the 'Arm64' VM architecture](https://user-images.githubusercontent.com/67620689/235617744-290da158-b092-4357-ab67-ee0ff7f1ac43.PNG)

### Run with Azure Spot discount

This is a low-cost pricing option. See <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/spot-vms">Azure documentation</a> for details. This does not affect the deployment of the virtual machine.

![Azure Spot discount option](https://user-images.githubusercontent.com/67620689/235617746-2fd534e4-c76f-4968-9e58-21b58f0b11c3.PNG)

### Size

Select an appropriate <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/sizes">size</a> for your compute needs from the pull-down.

![Select an appropriate VM size](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/49e9bf84-9ab4-4b61-a122-13e133bc59cb)

## Administrator account

This section defines how users <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/linux-vm-connect">connect</a> to the VM instance.

### Authentication type (Linux systems)

`SSH public key` is the most common and recommended choice.

![Select the 'SSH public key' authentication type](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/76ad2452-9c74-4de0-92db-32a33b047ade)

### Username

Create an appropriate username. The default username is `azureuser`. Windows VMs will also require a password to be set.

![Set a username for the VM](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/76ad2452-9c74-4de0-92db-32a33b047ade)

### SSH public key resource / Key pair name (Linux systems)

Use an existing key pair or generate a new one, as defined by `Key pair name`. If `Generate new key pair` is selected, your private key will be generated during the <a href="#create-instance">Create</a> step.

![Select or create a key pair](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/224e2eba-dba7-4e0e-8c59-a0b62406bdd3)

## Inbound port rules

These settings can be used to limit access to your VM. See the documentation for more info. This can generally be left as default. You can connect to Linux machines using SSH. You can connect to Windows machines using Remote Desktop Protocol (RDP).

![Configure inbound ports if necessary](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/1162315f-4b6f-44b4-ad2a-30874184287b)

## Licensing (Windows only)

Tick the box to confirm you have an appropriate license to deploy a Windows virtual machine. See the <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/windows/windows-desktop-multitenant-hosting-deployment">Azure documentation</a> for information.

## Other settings

There are other tabs defining many advanced settings. They can generally be left as default.

![Additional settings to configure the VM](https://github.com/ArmDeveloperEcosystem/arm-learning-paths/assets/71631645/8777ba85-aaa7-4454-88bd-88c82543bb46)

## Create instance

When the VM settings are to your liking, click on `Review + create`. Your settings will be validated by Azure. If valid, click on `Create` to create your VM instance.

![Review and create the instance](https://user-images.githubusercontent.com/67620689/235617805-c622aa34-5abf-47ce-bd02-cd9c01b60957.PNG)

After a short time, the VM will be created. Click on `Go to resource` to see various parameters, particularly the `Public IP address`.

## Connect to your VM instance (Linux)

These instructions are for Linux-based virtual machines. If you are using a Windows-based virtual machine, please jump to the <a href="#windows">Windows section</a>.

You can connect to the instance with your preferred SSH client. For example, if using the default username `azureuser`:

```
ssh -i <private_key> azureuser@<public_ip_address>
```

> Replace `<private_key>` with the private key on your local machine and `<public_ip_address>` with the public IP of the target VM.

You will also see this command under the `Connect` > `SSH` tab. Terminal applications such as <a href="https://www.putty.org/">PuTTY</a>, <a href="https://mobaxterm.mobatek.net/">MobaXterm</a> and similar can be used. Once connected, you are now ready to use your instance.

## Explore your instance (Linux)

### Run uname

Use the <a href="https://en.wikipedia.org/wiki/Uname">uname</a> utility to verify that you are using an Arm-based server. For example:

```
uname -m
```

will identify the host machine as `aarch64`.

### Run hello world

Install the `gcc` compiler. If you are using `Ubuntu`, use the following commands. If not, refer to the <a href="/install-guides/gcc/">GNU compiler install guide</a>:

```
sudo apt-get update
sudo apt install -y gcc
```

Using a text editor of your choice, create a file named `hello.c` with the contents below:

```c
#include <stdio.h>
int main(){
    printf("hello world\n");
    return 0;
}
```

Build and run the application:

```
gcc hello.c -o hello
./hello
```

The output is shown below:

```
hello world
```

## Connect to your VM instance (Windows)

These instructions are for Windows-based virtual machines. If you are using a Linux-based virtual machine, please jump to the <a href="#linux">Linux section</a>.

On your local host PC, launch the `Remote Desktop Connection` application. Enter the `Public IP Address` of the Windows VM as the `Computer` to be connected to. Username can also be specified. You will be prompted for the user password (set earlier), and you will connect. Once connected, you are now ready to use your instance. You can interact with the VM in the same way as you would a local desktop.

## Explore your instance (Windows)

Open `Control Panel` > `System` and verify that `Device` > `System Type` identifies as an Arm-based processor.

## Automating Arm Based Infrastructure Deployment

Cloud infrastructure deployment is typically done via Infrastructure as code (IaC) automation tools. There are Cloud Service Provider specific tools like <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/overview">Azure Resource Manager</a> and the open source tool <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview">Bicep</a>. There are also Cloud Service Provider agnostic tools like <a href="https://www.terraform.io/">Terraform</a>. There is a <a href="/learning-paths/servers-and-cloud-computing/azure-terraform/">deploying Arm instances on Azure using Terraform learning path</a> that should be reviewed next.
