Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit

Permalink
Azure dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jhicks committed Feb 8, 2022
1 parent 1a7edf0 commit 32bbe68
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 95 deletions.
143 changes: 96 additions & 47 deletions content/Azure/01_intro_to_cloud_console.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,40 @@
},
{
"cell_type": "markdown",
"id": "926df543",
"id": "7ba16e4b",
"metadata": {},
"source": [
"## The Who, What, and Where of the Cloud\n",
"\n",
"Before we get started we must first define, and find, a few key pieces of information about your environment that will be used throughout this lesson. This information is also important to ensure that this information is what you expect, otherwise you may use the wrong account or run or store things in the wrong place. It is important to be clear about these terms as they are often different in other cloud providers. \n",
"\n",
"(need glossary for Azure) We provide a [glossary of Azure terms](glossary.ipynb) for your reference."
"We provide a [glossary of Azure terms](glossary.ipynb) for your reference."
]
},
{
"cell_type": "markdown",
"id": "3e128379",
"id": "b8747e81",
"metadata": {},
"source": [
"## Accounts (Authentication and Identity) & login\n",
"\n",
"The (Azure) **Account** is the identity used to access the Azure web console and is in the form of an email address and is associated with an individual. This is typically the account you use to access Azure services associated with your institution and not your personal account. We will now login to the Azure web console and verify our account.\n",
"\n",
" * Login to the web console with your (Azure) account by going to [https://portal.azure.com//](https://portal.azure.com//)\n",
" * Fill in your username and password (assigned to you in the an email from CLASS or perhap from your institution. \n",
" * Find your user/account under the \"Avatar\" in the top right (see number 4 below).\n",
" * Fill in your username and password (assigned to you in the an email from CLASS or perhap from your institution). \n",
" * Find your user/account under the \"Avatar\" in the top right (see number 5 below).\n",
"\n",
"You are now logged on. Welcome to the first step of your cloud journey!"
"You are now logged in. Welcome to the first step of your cloud journey!"
]
},
{
"cell_type": "markdown",
"id": "90066c19",
"id": "6f9af1ea",
"metadata": {},
"source": [
"### Exercise\n",
"\n",
"Take a few moments to ask yourself the following questions:\n",
" * What account are you currently using in the Google Cloud web console?\n",
" * What account are you currently using in the Azure Cloud web console?\n",
" * Are you logged into any other accounts?\n",
" * How do you know which account is being used?\n",
" \n",
Expand All @@ -71,66 +70,50 @@
},
{
"cell_type": "markdown",
"id": "160353bd",
"id": "4901d3bb",
"metadata": {},
"source": [
"## Subscriptions\n",
" \n",
"Click on the *Directories & Subscriptions* buttton (#4).\n",
"Verify that you are in the right *Directory and Subscription* (briefly discribe D&S).\n",
"Click on the *Directories & Subscriptions* buttton (number 4 below).\n",
"Verify that you are in the right *Directory and Subscription* (For more information on Directories and Subscriptions, see the *glossary of Azure terms* link above).\n",
" \n",
"Take a few moments to ask yourself the following questions:\n",
" * What is the *name* of the Project you are currently using in the Google Cloud Platform web console?\n",
" * What is the *Project ID* of that project?\n",
" * What is the *Project Number* of that project?\n",
" * Do you have multiple projects?\n",
" * How do you know which project you are currently using?\n",
"\n",
"If you are currently not using the correct project for this lesson, switch to the correct one."
]
},
{
"cell_type": "markdown",
"id": "6e3b3cbd",
"metadata": {},
"source": [
"## Services\n",
"\n",
"The web console is used to control and observe the cloud from the browser. It should only be used for simple and one-time tasks, exploring new services, accessing documentation, or for monitoring and debugging resources in the cloud. Programmatic control through the console, programming languages (for example Python), and other automation tools should be used for day to day activities to make the most out of the cloud and to help with the reproducibility of research and teaching.\n",
" * What is the *name* of the Subscription you are currently using in the Azure web console?\n",
" * Do you have multiple subscriptions?\n",
" * How do you know which subscription you are currently using?\n",
"\n",
"The Navigation Menu (number 1 above) is used to navigate to the various products, which are also sometimes called services.\n"
"If you are currently not using the correct subscription for this lesson, switch to the correct one."
]
},
{
"cell_type": "markdown",
"id": "b474c54d",
"id": "d2611421",
"metadata": {},
"source": [
"## Services\n",
"\n",
"The web console is used to control and observe the cloud from the browser. It should only be used for simple and one-time tasks, exploring new services, accessing documentation, or for monitoring and debugging resources in the cloud. Programmatic control through the console, programming languages (for example Python), and other automation tools should be used for day to day activities to make the most out of the cloud and to help with the reproducibility of research and teaching.\n",
"\n",
"The Navigation Menu (often called the hamburger) is used to navigate to the various products, which are also sometimes called services.\n",
"The Navigation Menu (number 1 below) is used to navigate to the various products, which are also called services.\n",
"\n",
"![hamburger-navigation](images/hamburger-navigation.png)\n",
"![hamburger-navigation](images/Azure-services-menu.png)\n",
"\n",
" * Click on a product to navigate the product page\n",
" * You can pin frequently used items on the top of this page by clicking on the pin icon. \n",
" * Click on a product to navigate to the product page \n",
" * Click the hamburger again to hide the Left Sidebar.\n",
"\n",
"All the different products and services are the \"What\" of the cloud. We will start with compute, called *Google Compute Engine* in the next Episode. \n",
"All the different products and services are the \"What\" of the cloud. We will start with compute, called *Azure VM* in the next Episode. \n",
"\n",
"### Exercise \n",
"\n",
"Take a few moments to navigate a few key services.\n",
" * Navigate to the \"Compute Engine\" service under the \"Compute\" product group.\n",
" * You will probably need to \"Enable\" this service first by clicking on the \"Enable\" button on the \"Compute Engine API\" page. This will only need to be done once per project.\n",
" * Navigate to \"Cloud Storage\" under the \"Storage\" product group and enable the service if necessary."
"Take a few moments to navigate to a few key services.\n",
" * Navigate to the \"Virtual Machine\" service in the Left Sidebar menu.\n",
" * Navigate to \"Storage Accounts\" service in the Left Sidebar menu.\n"
]
},
{
"cell_type": "markdown",
"id": "a25ba0f1",
"id": "13817be0",
"metadata": {},
"source": [
"## Everything Else\n",
Expand Down Expand Up @@ -160,7 +143,7 @@
},
{
"cell_type": "markdown",
"id": "e94b53e2",
"id": "5ab062d4",
"metadata": {},
"source": [
"## Open a Cloud Shell\n",
Expand All @@ -169,14 +152,80 @@
"\n",
"To use the Cloud Shell:\n",
" * Open up a Cloud Shell by clicking on the **Cloud Shell** icon in the right side of the top blue bar (number 3 above).\n",
" * Once the Cloud Shell is open, you should see \"Welcome to Azure Cloud Shell\".\n",
" * Once the Cloud Shell is open and has initialized, you should see \"Welcome to Azure Cloud Shell\".\n",
" * Click the middle box icon on the right side of the Cloud Shell bar to maximize the screen. You can find the correct icon by hovering over the icons to see their names.\n",
" * Note: You can open the Cloud Shell in a new tab by clicking on the **Open new session** icon (looks like a box with a \"+\") in the middle of the Cloud Shell bar.\n"
" * Note: You can open the Cloud Shell in a new tab by clicking on the **Open new session** icon (looks like a box with a \"+\") in the middle of the Cloud Shell bar.\n",
"\n",
"![Azure-cloud-shell](images/Azure-cloud-shell.png)\n",
"\n",
"You will notice that in the upper left corner of the cloud shell there is a pull down menu. This should be set to **bash** (The other option is PowerShell). We will now prepare for the next lessons by creating an ssh key."
]
},
{
"cell_type": "markdown",
"id": "53d98252",
"metadata": {},
"source": [
"Now we will create a ssh key pair to use with some of the other lessons (e.g. we need a ssh key when creating a VM in order to login securely).\n",
"\n",
"At the **$** prompt, enter **ssh-keygen** and follow the prompts."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "be8b4eb8",
"metadata": {},
"outputs": [],
"source": [
"$ ssh-keygen\n",
"Generating public/private rsa key pair.\n",
"Enter file in which to save the key (/home/john/.ssh/id_rsa):"
]
},
{
"cell_type": "markdown",
"id": "af178e4d",
"metadata": {},
"source": [
"This prompt is asking you to create a .ssh directory in your home directory and generate ssh public/private keys named id_rsa.pub/id_rsa (default).\n",
"\n",
"Press enter to continue to create the key. You will see another message asking you for a passphrase, similar to the following:\n",
"```\n",
"Generating public/private rsa key pair.\n",
"Enter passphrase (empty for no passphrase):\n",
"```\n",
"Here you should enter a passphrase (a series of words) to protect the key. You will be asked to re-enter the passphrase as shown below:\n",
"```\n",
"Enter same passphrase again:\n",
"```\n",
"\n",
"After successfully retyping the passphrase the key generation process will continue showing similar message as follows (the fingerprint and art will look different):\n",
"```\n",
"Your identification has been saved in /home/learner/.ssh/id_rsa.\n",
"Your public key has been saved in /home/learner/.ssh/id_rsa.pub.\n",
"The key fingerprint is:\n",
"SHA256:D9yj1nZEUigahirvjkIFoCP7RfjDu67Ku88M7nHQftI learner@cs-748001990186-default-boost-r9phq\n",
"The key's randomart image is:\n",
"+---[RSA 2048]----+\n",
"|o . .. |\n",
"|.. .. o . .. |\n",
"|+ o... o .. . |\n",
"|ooo= .. . o |\n",
"|.+..= S o . |\n",
"| o+..o = o |\n",
"|.+.+.E o + . |\n",
"|+.B o. . . . |\n",
"|=O**o |\n",
"+----[SHA256]-----+\n",
"```\n",
"\n",
"The ssh key generation is now complete. This will only happen once for your account. Later during the VM create proces you will be asked to Cut & Paste the public key into a form. "
]
},
{
"cell_type": "markdown",
"id": "e17944ad",
"id": "779c8715",
"metadata": {},
"source": [
"## Exercise\n",
Expand All @@ -197,7 +246,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -211,7 +260,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
31 changes: 17 additions & 14 deletions content/Azure/02_intro_to_compute.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,23 @@
},
{
"cell_type": "markdown",
"id": "3565e61f",
"id": "eb6326d6",
"metadata": {},
"source": [
"## Azure Virtual Machines"
]
},
{
"cell_type": "markdown",
"id": "4efebb57",
"id": "ce935ec7",
"metadata": {},
"source": [
"Before we begin this lesson/episode we need to create a ssh key in order to login into the VM we about to create. We will use the public key when we create the VM.\n",
"\n",
"**Note:** Step 1. below is not required if you have already created a ssh key in the [Intro to Cloud Console](01_intro_to_cloud_console.ipynb) lesson. If you have already created a key go directly to step 2.\n",
"\n",
"**Step 1.**\n",
"\n",
"If you have not used the cloud shell to connect to a *VM Instance* before you will need to create a new *ssh key*. The Compute Engine will use this key to allow you to access the *VM instance* in a secure manner. If this is the case you will see a message similar to the following:\n",
"```\n",
"WARNING: The private SSH key file for gcloud does not exist.\n",
Expand Down Expand Up @@ -95,20 +99,17 @@
"\n",
"The ssh key generation is now complete. This will only happen once for your account. Later during the VM create proces you will be asked to Cut & Paste the public key into a form. \n",
"\n",
"Copy the public key to your clip board \n",
"\n",
"\n",
"future connections.\n"
"**Step 2.**\n",
"Copy the public key to your clip board future connections.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7245d24e",
"cell_type": "markdown",
"id": "0f47f212",
"metadata": {},
"outputs": [],
"source": [
"cat /home/learner/.ssh/azure_compute_engine.pub"
"cat /home/learner/.ssh/id_rsa.pub"
]
},
{
Expand Down Expand Up @@ -294,7 +295,7 @@
},
{
"cell_type": "markdown",
"id": "bb819970",
"id": "41119145",
"metadata": {},
"source": [
"## Clean up\n",
Expand All @@ -314,7 +315,9 @@
"* Select the Resource Group to delete.\n",
"* Click delete\n",
"* A warning will ask you to enter the name of the Resource Group to make sure you want to continue with this perminent operation.\n",
"* Confirm that you want ot delete the Resouce Group."
"* Confirm that you want ot delete the Resouce Group.\n",
"\n",
"Note: By deleting the Resource Group you will delete all services under it."
]
},
{
Expand All @@ -328,7 +331,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -342,7 +345,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 32bbe68

Please sign in to comment.