diff --git a/content/Azure/01_intro_to_cloud_console.ipynb b/content/Azure/01_intro_to_cloud_console.ipynb index ccdbac9..7619591 100644 --- a/content/Azure/01_intro_to_cloud_console.ipynb +++ b/content/Azure/01_intro_to_cloud_console.ipynb @@ -28,19 +28,18 @@ }, { "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", @@ -48,21 +47,21 @@ "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", @@ -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", @@ -160,7 +143,7 @@ }, { "cell_type": "markdown", - "id": "e94b53e2", + "id": "5ab062d4", "metadata": {}, "source": [ "## Open a Cloud Shell\n", @@ -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", @@ -197,7 +246,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -211,7 +260,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.9.7" } }, "nbformat": 4, diff --git a/content/Azure/02_intro_to_compute.ipynb b/content/Azure/02_intro_to_compute.ipynb index 5c47b31..d401cb0 100644 --- a/content/Azure/02_intro_to_compute.ipynb +++ b/content/Azure/02_intro_to_compute.ipynb @@ -38,7 +38,7 @@ }, { "cell_type": "markdown", - "id": "3565e61f", + "id": "eb6326d6", "metadata": {}, "source": [ "## Azure Virtual Machines" @@ -46,11 +46,15 @@ }, { "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", @@ -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" ] }, { @@ -294,7 +295,7 @@ }, { "cell_type": "markdown", - "id": "bb819970", + "id": "41119145", "metadata": {}, "source": [ "## Clean up\n", @@ -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." ] }, { @@ -328,7 +331,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -342,7 +345,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.9.7" } }, "nbformat": 4, diff --git a/content/Azure/05_intro_to_cloud_storage_cli.ipynb b/content/Azure/05_intro_to_cloud_storage_cli.ipynb index ef2660e..b082779 100644 --- a/content/Azure/05_intro_to_cloud_storage_cli.ipynb +++ b/content/Azure/05_intro_to_cloud_storage_cli.ipynb @@ -45,24 +45,12 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'eastus' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mRG\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"demo_rg\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mLOCATION\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0meastus\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mBLOB_CON\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"demo_blob_cont\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mSTGE_ACCT\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"demo_stor_ac\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mCTR\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"demo_stge_ctr\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mNameError\u001b[0m: name 'eastus' is not defined" - ] - } - ], + "outputs": [], "source": [ "RG=\"demo_rg\"\n", - "LOCATION=eastus\n", + "LOCATION=\"eastus\"\n", "BLOB_CON=\"demo_blob_cont\"\n", "STGE_ACCT=\"demo_stor_ac\"\n", "CTR=\"demo_stge_ctr\"" @@ -76,8 +64,10 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "az group create --name $RG --location $LOCATION" ] @@ -93,9 +83,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (838669738.py, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"/var/folders/ty/h84mzh251vdbfwf3zsph_xrh0000gq/T/ipykernel_80687/838669738.py\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m az storage account create --name $STGE_ACCT --resource-group $RG --location $LOCATION --sku Standard_ZRS --encryption-services blob\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], "source": [ "az storage account create --name $STGE_ACCT --resource-group $RG --location $LOCATION --sku Standard_ZRS --encryption-services blob" ] @@ -332,7 +331,7 @@ "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -346,7 +345,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.9.7" } }, "nbformat": 4, diff --git a/content/Azure/glossary.ipynb b/content/Azure/glossary.ipynb index e690bf9..f7501e9 100644 --- a/content/Azure/glossary.ipynb +++ b/content/Azure/glossary.ipynb @@ -2,31 +2,43 @@ "cells": [ { "cell_type": "markdown", - "id": "1f0027c2-df7b-426e-b4f4-3e1db9916d14", + "id": "efd09804", "metadata": {}, "source": [ "# Glossary\n", "\n", - "* **Account** - The Google account (email) associated with an individual. This is the identity that you use to access console and takes the form of an email address.\n", - "* **Project** - Resources and services in Google Cloud are created within a single Project. \n", - "* **Project Name** - The long human readable name of your project. You can change this.\n", - "* **Project ID** - an alpha-numeric string identifier for the project. This is not changeable.\n", - "* **Project Number** - a long number that also identifies the project but is rarely used (it is an internal identifier). \n", - "* **Billing Account** - an account used to pay for Google Cloud services. A Billing Account is associated with a Project and enables resource allocation. A project has only one Billing Account associated with it. A Billing account can be used for multiple Projects." + "* **Active Directory** - This is were your identity is defined. This is typically setup by the institution that you belong to.\n", + "* **Subscription** - Resources and services in Azure are created within a Subsrciption and this acts as your billing account. \n", + "* **Account** - The Azure account (email) associated with an individual. This is the identity that you use to access console.\n", + "* **Resource Group** - A resource group is a *container* (in the literal sense not to be confused with a Docker container for example) that holds related resources that you want to manage as a group." ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "471d2fe5", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Bash", - "language": "bash", - "name": "bash" + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" }, "language_info": { - "codemirror_mode": "shell", - "file_extension": ".sh", - "mimetype": "text/x-sh", - "name": "bash" + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.7" } }, "nbformat": 4, diff --git a/content/Azure/images/Azure-cloud-shell.png b/content/Azure/images/Azure-cloud-shell.png new file mode 100644 index 0000000..5d86347 Binary files /dev/null and b/content/Azure/images/Azure-cloud-shell.png differ diff --git a/content/Azure/images/Azure-services-menu.png b/content/Azure/images/Azure-services-menu.png new file mode 100644 index 0000000..416acdc Binary files /dev/null and b/content/Azure/images/Azure-services-menu.png differ diff --git a/content/Azure/images/hamburger-navigation.png b/content/Azure/images/hamburger-navigation.png new file mode 100644 index 0000000..41423f2 Binary files /dev/null and b/content/Azure/images/hamburger-navigation.png differ