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.
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.
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.
In your student email inbox, you will have an email from Microsoft Azure azure-noreply@microsoft.com with the subject You’ve been asked to accept Azure subscription ownership.
Open the email.
Right click in the blue box where it says Accept ownership and open the link in a private/incognito browser page
In the sign in page enter
NetID@georgetown.edu
Authenticate with your GU credentials and two-factor-authentication
You may be prompted for additional information, click Next
Once you enter all additional information, verify and click looks good
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.
You will end up in the Accept subscription ownership page. Click Review + accept
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.
Click Accept
You will end up in Welcome to Azure page! and your Azure account is ready to be used!
Log out of Azure and log back in to ensure that everything us updated.
Sign in to the Azure Portal
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
- Go to the Azure Portal
- In the sign in page, use your username in the form of
NETID@georgetown.edu
- If you get shown a page that looks like the one below, select Work or School Account
- Authenticate with your institution’s two-factor-authentication
- 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
- Sign in to the Azure portal if you are not already signed in
- Click on Home or on Microsoft Azure in the top left
- 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)
- Click on the
Subscriptions
oval and select Show all subscriptions - Uncheck the checkbox that says Show only subscriptions selected in the global subscriptions filter
- You will see a subscription called
DSAN6000 Fall 2024 Individual_XXXXX_YYYYY
whereXXXX
is your first name, andYYYY
is your last name. - Click on your subscription name
- 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.
You will create a resource group ony once. Once it is created you do not need to create one again.
Sign in to Azure if not already signed in. Follow the instructions in the sign in page.
Click on Microsoft Azure in the top left to go to the Azure Portal home screen
Click on Resource groups
Click on the Subscription Filter and make sure your subscription is selected
Click Create
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
Click Review + create at the bottom left
After validation passes, click Create
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
You will do this only once.
Click on Home in the top left
Type
ssh keys
in the search bar, and click on SSH Keys serviceClick Create
Select the right subscription from the dropdown
Select the resource group you created earlier from the dropdown.
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)
Select Upload existing public key from the SSH public key source dropdown
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)
Click Review + create
After validation passes, click Create
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
Click on Home in the top left
Type
virtual machines
in the search bar, and click on the Virtual machines serviceClick Create and then Azure virtual machine
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
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
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.
- 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
- In the Essentials section on the overview panel, you can see the public IP address. Copy that.
The IP address may change every time you start the same virtual machine from a stopped (paused) state.
- Open a terminal on your laptop. If you have one already open, type
cd ~
to navigate back to your home directory - 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.
- Go to the VM overview panel
- Click on Stop
- Confirm you want to stop it by clicking OK
- To start again in the future, click on Restart, though the IP address may change
Delete a virtual machine
- Go to the VM Overview page for the VM you just created. You can get there multiple ways.
- Click on Delete
- Select all associated resources to the VM (OS Disk, Network interfaces, and Public addresses) to be deleted
- Confirm you want to delete it by clicking OK
Deploy Azure Machine Learning (AzureML)
You will only deploy the service once.
- Sign in to the Azure Portal as described in the sign in page
- In the search bar at the top, type
azure machine learning
- Click on Azure Machine Learning entry under Services
- From the Azure Machine Learning service page (which will be empty), Click on + Create
- Select New workspace from the dropdown
- Select your subscription from the Subscription drow-down
- Select the resource group you crated from the dropdown
- 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. - Make sure the region is East US 2
- Click Review + create
- 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.
You will start with creating (and using) a single compute instance. To create additional compute instances, the process is the same.
- Log into AzureML Studio
- Select your workspace
- Click on Compute on the left-hand navigation panel (towards the bottom)
- Click + New
- 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
(changeto your own.) - Select CPU
- Select the Standard_E4ds_v4 instance size
- Click Next
- Make sure Auto shut down is enabled and change the value to 30
- Click Review + Create
- Verify all settings
- Click Create
When the compute instance gets created it will be running. It should shut-down after 30 minutes of inactivity.