Microsoft Azure

A fully functional Microsoft Azure individual subscription will be created for you with credits. Most Azure services are available in this account.

Follow these instructions to setup your Azure environment. The screenshots may look a bit different than what you are seeing, but the flow is the same.

A note on managing your credits:

Unlike the AWS managed Vocareum environment, in Azure you will have to manually stop down your resources to avoid consuming your credits.

Important

You must begin by accepting ownewship of the Azure Subscription


Accept the Azure subscription ownership

In this step, you will login to Azure for the first time and take ownership of a subscription that was created for you by Prof. Marck.

Note

This step is only done once.

Steps to accept and access your Azure subscription:

Please perform this step in a private browser window. You may not need to use a private browser window in the future, but it is recommended for this step.

  1. In your student email inbox, you will have an email from Microsoft Azure with the subject You’ve been asked to accept Azure subscription ownership.

  2. Open the email.

  3. Right click in the blue box where it says Accept ownership and open the link in a private/incognito browser page

  4. In the sign in page enter NetID@georgetown.edu

  5. Authenticate with your GU credentials and two-factor-authentication

  6. You may be prompted for additional information, click Next

  7. Once you enter all additional information, verify and click looks good

  8. You will continue the sign in process and asked if you would like to stayed sign in. Since you are using a private browser it doesn’t matter.

  9. You will end up in the Accept subscription ownership page. Click Review + accept

Caution

When you get to this step, please pause a moment and wait.

The best strategy for the next step if you are in the classroom with others is to stagger the clicking of Accept because if too many people do it at once there is a high possibility of errors. Coordinate amongst yourselves to do no more than 10 at a time.

  1. Click Accept

  2. You will end up in Welcome to Azure page! and your Azure account is ready to be used!

  3. Log out of Azure and log back in to ensure that everything us updated.


Sign in to the Azure Portal

Important

You must have already accepted ownership of the Azure subscription created for you before you sign in.

The URL to sign in to the Azure Portal is https://portal.azure.com

  1. Go to the Azure Portal
  2. In the sign in page, use your username in the form of NETID@georgetown.edu
  3. If you get shown a page that looks like the one below, select Work or School Account
  4. Authenticate with your institution’s two-factor-authentication
  5. When you finish signing in, you’ll be at the Azure Portal home page, and you are ready to work in Azure!

Find your Azure Subscription information

  1. Sign in to the Azure portal if you are not already signed in
  2. Click on Home or on Microsoft Azure in the top left
  3. Click on Subscriptions (the key icon). You will see a list of all subcriptions associated with you Azure account (which is in turn, associated with your Georgetown email)
  4. Click on the Subscriptions oval and select Show all subscriptions
  5. Uncheck the checkbox that says Show only subscriptions selected in the global subscriptions filter
  6. You will see a subscription called DSAN6000 Fall 2024 Individual_XXXXX_YYYYY where XXXX is your first name, and YYYY is your last name.
  7. Click on your subscription name
  8. In this page you can see all information regarding your subscription. You may want to keep the Subscription ID handy for identification purposes

Create an Azure resource group

Microsoft Azure uses a logical grouping called resource groups. Any resource you create in Azure has to be within a Resource Group. Resource groups typically have a default region, but you can still have resources deployed in multiple regions within a single resource group.

For this course, you will create a single resource group for all your Azure services in the East US 2 region. All the Azure services and resources you will use will be within this resource group.

Note

You will create a resource group ony once. Once it is created you do not need to create one again.

  1. Sign in to Azure if not already signed in. Follow the instructions in the sign in page.

  2. Click on Microsoft Azure in the top left to go to the Azure Portal home screen

  3. Click on Resource groups

  4. Click on the Subscription Filter and make sure your subscription is selected

  5. Click Create

  6. In the Create a resource group page:

    • Select your subscription from the dropdown
    • Enter a name for the resource group. The name can be anything. Use the course number DSAN6000
    • Select (US) East US 2 from the dropdown
  7. Click Review + create at the bottom left

  8. After validation passes, click Create

  9. Once the RG is created, you’ll see it in the RG list (if your right subscriptions are selected in the filter)


Upload your public ssh key to Azure

Note

You will do this only once.

  1. Click on Home in the top left

  2. Type ssh keys in the search bar, and click on SSH Keys service

  3. Click Create

  4. Select the right subscription from the dropdown

  5. Select the resource group you created earlier from the dropdown.

  6. Give the key a name (it’s just a name, it doesn’t matter what it is as long as you know what it is)

  7. Select Upload existing public key from the SSH public key source dropdown

  8. In the Upload key box, paste the contents of your public key:

    • ~/.ssh/id_rsa.pub (Mac/Linux)
    • C:\Users\<your_name>\.ssh\id_rsa.pub (Windows)
  9. Click Review + create

  10. After validation passes, click Create

  11. Once the SSH Key is uploaded, you’ll see it in the SSH Key list (if your right subscriptions are selected in the filter). You may have to hit “Refresh” on your browser for the page to update with your ssh key.

.


Create and launch IAAS virtual machine on Azure

  1. Click on Home in the top left

  2. Type virtual machines in the search bar, and click on the Virtual machines service

  3. Click Create and then Azure virtual machine

  4. In the Create a virtual machine page

    • Select the right subscription from the dropdown
    • Select the right resource group from the dropdown (the one you created earlier)
    • In the Instance details section:
      • Give your VM a name
      • Leave all other values unchanged
      • For the size, click see all sizes, select size B2s and click Select at the bottom
    • In the Administrator account section:
      • Leave SSH public key checked
      • Leave azureuser as Username
      • Select Use existing key stored in Azure from the SSH public key source dropdown
      • Select the key you uploaded earlier by name from the dropdown
    • In the Inbound port rules section:
      • Leave Allow selected ports selected
      • Leave SSH (22) in the _Select inbound ports dropdown
    • Click Review + create
    • After validation passes, click Create
Note

You can ignore the warning “You have set SSH port(s) open to the internet”. This is what we need for our setup.

  • Once the VM is created you’ll see a notice and click Go to resource

  • You will end up in the VM overview panel
  • In the VM overview panel, you can see the machine’s public IP address. You will need this to be able to connect to it.

Explore all the resources that got created with a single virtual machine

When you created the virtual machine, there were actually several other resources that were created at the same time which are tied to the virtual machine. You can see all the resources in the resource group by navigating to the resource group’s summary panel:

Networking resources

  • A vnet(virtual network): a virtual network within Azure with it’s own networking address space where you can have many resources that can communicate with one-another. You can have several vnets.
  • A network security group: a set of inbound/outbound networking rules (firewall) associated with a virtual network.
  • A network interface: the actual “network card” that is associated with a given virtual machine. A single machine can have multuple network interfaces. Every network integrace also gets an internal IP address.
  • A public IP address: a public IP address (fixed or rotating) that is associated with a network interface.

Computing resources

  • The actual virtual machine (virtual hardware) which has a specific machine type

Storage resources

  • The system hard drive that has the operating system for a given virtual machine. A machine must have a system drive, and it can also have several other drives

Connect to a virtual machine using Secure Shell ssh

Important

Make sure that you are connected to the Saxanet WiFi network and not the GuestNet network. SSH (TCP port 22) is blocked on GuesNet which means if you are on GuesNet you wil not be able to connect to your cloud VMs or clone repos from GitHub via SSH. Use SaxaNet.

  1. Go to the VM Overview page for the VM you just created. You can get there multiple ways:
  • From the home screen
  • From the resource group summary page
  • From the virtual machines list
  1. In the Essentials section on the overview panel, you can see the public IP address. Copy that.
Note

The IP address may change every time you start the same virtual machine from a stopped (paused) state.

  1. Open a terminal on your laptop. If you have one already open, type cd ~ to navigate back to your home directory
  2. Type ssh azureuser@ and paste your IP address
  • If everything is configured correctly, the first time you connect to a host that you’ve never connected to, you will see something like this:
The authenticity of host 'xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)' can't be established.
ECDSA key fingerprint is SHA256:TeYrgHLkYHvD/zcp23bO3wozsLMyPSiSn+edPPo88zE.
Are you sure you want to continue connecting (yes/no)?

Note: your values for IP address and fingerprint will be different

  • Enter yes and press enter. You will only need to enter yes once.
  • If you are successful, you will see something like this:
Warning: Permanently added '20.7.145.120' (ED25519) to the list of known hosts.
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.15.0-1017-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Sep  6 16:32:56 UTC 2022

  System load:  0.0               Processes:             112
  Usage of /:   5.0% of 28.89GB   Users logged in:       0
  Memory usage: 7%                IPv4 address for eth0: 10.0.0.4
  Swap usage:   0%

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

1 update can be applied immediately.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

azureuser@my-vm-name:~$

Congratulations, you have successfully connected to your VM on Azure


Stop (pause) the virtual machine

There are two concepts you need to understand:

  • Stopping a VM is like turning the machine off. The current state is saved and you can turn it on again later. No hourly charges are incurred while in this state (although some storage charges may occur.)
  • Deleting a VM completely removes it. This cannot be undone.
  1. Go to the VM overview panel
  2. Click on Stop
  3. Confirm you want to stop it by clicking OK
  4. To start again in the future, click on Restart, though the IP address may change

Delete a virtual machine

  1. Go to the VM Overview page for the VM you just created. You can get there multiple ways.
  2. Click on Delete
  3. Select all associated resources to the VM (OS Disk, Network interfaces, and Public addresses) to be deleted
  4. Confirm you want to delete it by clicking OK

Deploy Azure Machine Learning (AzureML)

Note

You will only deploy the service once.

  1. Sign in to the Azure Portal as described in the sign in page
  2. In the search bar at the top, type azure machine learning
  3. Click on Azure Machine Learning entry under Services
  4. From the Azure Machine Learning service page (which will be empty), Click on + Create
  5. Select New workspace from the dropdown
  6. Select your subscription from the Subscription drow-down
  7. Select the resource group you crated from the dropdown
  8. Enter aml as the Name. You will notice that Storage account, Key vault, and Application insights values will auto-populate, and the Container registry value will be “None”. Do not change anything in those four fields.
  9. Make sure the region is East US 2
  10. Click Review + create
  11. Click Create once validation passes

Your AzureML workspace will begin to be deployed. You’ll see a notification when it’s done.

Access AzureML Studio

Once the workspace is deployed you can access it by a direct URL (bookmark this): https://ml.azure.com/.

If you are not logged into Azure you will be asked to log in.

Create Compute Instance within AzureML

This is a managed compute instance, separate from the one you created as IAAS.

Important

You will start with creating (and using) a single compute instance. To create additional compute instances, the process is the same.

  1. Log into AzureML Studio
  2. Select your workspace
  3. Click on Compute on the left-hand navigation panel (towards the bottom)
  4. Click + New
  5. Enter a Compute name (you can edit the default value.) This value has to be globally unique, so we recommend calling the compute instance dsan6000-<NETID>-ci01 (change to your own.)
  6. Select CPU
  7. Select the Standard_E4ds_v4 instance size
  8. Click Next
  9. Make sure Auto shut down is enabled and change the value to 30
  10. Click Review + Create
  11. Verify all settings
  12. Click Create

When the compute instance gets created it will be running. It should shut-down after 30 minutes of inactivity.