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

Commit

Permalink
Merge pull request #36 from CLASS/azure-dev
Browse files Browse the repository at this point in the history
Azure dev
  • Loading branch information
amanda-tan authored Feb 17, 2022
2 parents 9dc0a64 + bc52451 commit 5e114ed
Show file tree
Hide file tree
Showing 16 changed files with 142 additions and 79 deletions.
81 changes: 53 additions & 28 deletions content/Azure/01_intro_to_cloud_console.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,81 +39,100 @@
},
{
"cell_type": "markdown",
"id": "b8747e81",
"id": "f1a257c4",
"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",
"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 (the *who* is you!). 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",
" * 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 5 below).\n",
" * Find your user/account under the \"Avatar\" in the top right corner of the console (see number 5 below).\n",
"\n",
"You are now logged in. Welcome to the first step of your cloud journey!"
]
},
{
"cell_type": "markdown",
"id": "6f9af1ea",
"id": "888bdfdc",
"metadata": {},
"source": [
"### Exercise\n",
"```{admonition} Exercise\n",
"\n",
"Take a few moments to ask yourself the following questions:\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",
" If you are not currently using the correct account, switch to it."
" If you are not currently using the correct account, switch to it.\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "4901d3bb",
"id": "651055e4",
"metadata": {},
"source": [
"## Subscriptions\n",
" \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",
"Click on the *Directories & Subscriptions* button in the console (number 4 below).\n",
"Verify that you are in the right *Active Directory and Subscription* (For more information on Active Directories and Subscriptions, see the *glossary of Azure terms* link above)."
]
},
{
"cell_type": "markdown",
"id": "bc064a57",
"metadata": {},
"source": [
"```{admonition} Exercise\n",
"Take a few moments to ask yourself the following questions:\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",
"If you are currently not using the correct subscription for this lesson, switch to the correct one."
"If you are currently not using the correct subscription for this lesson, switch to the correct one.\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "d2611421",
"id": "d2e2654b",
"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",
"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, \n",
"exploring new services, accessing documentation, or for monitoring and debugging resources in the cloud. Programmatic control \n",
"through the console (cloud shell), programming languages (for example Python), and other automation tools should be used for day to \n",
"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 (number 1 below) is used to navigate to the various products, which are also called services.\n",
"\n",
"![hamburger-navigation](images/Azure-services-menu.png)\n",
"![service-navigation](images/Azure-services-menu.png)\n",
"\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 *Azure VM* in the next Episode. \n",
"\n",
"### Exercise \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"
]
},
{
"cell_type": "markdown",
"id": "880a3b4d",
"metadata": {},
"source": [
"```{admonition} Exercise\n",
"\n",
"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"
" * Navigate to \"Storage Accounts\" service in the Left Sidebar menu.\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "13817be0",
"id": "43cd9544",
"metadata": {},
"source": [
"## Everything Else\n",
Expand All @@ -123,7 +142,7 @@
"\n",
"The top of your screen should look very similar to the following when you log in to the Azure console. Next, let's take a closer look at some key concepts and components of the Azure console. \n",
"\n",
"![cloud-shell](images/azure_intro_console.jpg)\n",
"![cloud-shell](images/azure_intro_console.png)\n",
"\n",
"**1. Navigation Menu (often called the hamburger)**\n",
": If you click on the hamburger (three horizontal lines) you will get a dropdown menu and see a list of services that are offered by Azure. Currently, Azure has over N services ranging from compute to machine learning to networking to data storage. The list grows frequently!\n",
Expand All @@ -143,15 +162,21 @@
},
{
"cell_type": "markdown",
"id": "5ab062d4",
"id": "a06f390f",
"metadata": {},
"source": [
"## Open a Cloud Shell\n",
"\n",
"The Cloud Shell is an easy way to access Comand Line Interface (CLI) commands in a web browser. Under the hood Cloud Shell is Debian running in a container with 5GB of minimal-charge persistent storage and a lot of other useful tools (git, docker, jq, Docker, etc.) installed by default.\n",
"The Cloud Shell is an easy way to access Comand Line Interface (CLI) commands in a web browser. Under the hood Cloud Shell is Common Base Linux Delridge (CBL is a free and open-source, Linux distribution that Microsoft has developed) OS running in a container with 5GB of persistent storage and a lot of other useful tools (git, jq, Docker, etc.) installed by default.\n",
"\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",
" * The first time you open cloud shell you will be prompted for the following:\n",
"![welsome-to-cloud-shell-bashl](images/welsome-to-cloud-shell-bash.png)\n",
" * Choose *bash* to continue.\n",
" * Then it will ask you to create a storage account for persistant storage for your cloud shell experience.\n",
"![welcome-to-cloud-shell-storage](images/welcome-to-cloud-shell-storage.png)\n",
" * Click create storage (The storge will encurre a nomial fee)\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",
Expand All @@ -163,7 +188,7 @@
},
{
"cell_type": "markdown",
"id": "53d98252",
"id": "de9c6bdb",
"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",
Expand All @@ -178,17 +203,17 @@
"metadata": {},
"outputs": [],
"source": [
"$ ssh-keygen\n",
"$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",
"id": "a1c0e980",
"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",
"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) respectively.\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",
Expand All @@ -200,7 +225,7 @@
"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",
"After successfully retyping the passphrase the key generation process will continue showing a 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",
Expand Down
12 changes: 8 additions & 4 deletions content/Azure/02_intro_to_compute.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
]
},
{
"cell_type": "markdown",
"id": "eb6326d6",
"cell_type": "code",
"execution_count": null,
"id": "b85b77ed",
"metadata": {},
"outputs": [],
"source": [
"## Azure Virtual Machines"
]
Expand Down Expand Up @@ -121,9 +123,11 @@
]
},
{
"cell_type": "markdown",
"id": "9c8830ce",
"cell_type": "code",
"execution_count": null,
"id": "0d5b8abd",
"metadata": {},
"outputs": [],
"source": [
"## Create a VM\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions content/Azure/03_intro_to_cloud_storage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -231,7 +231,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
38 changes: 21 additions & 17 deletions content/Azure/04_intro_to_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 1,
"id": "d00a37e4",
"metadata": {},
"outputs": [],
Expand All @@ -213,11 +213,21 @@
]
},
{
"cell_type": "markdown",
"id": "6b5db328",
"cell_type": "code",
"execution_count": 2,
"id": "2cf44876-a1c7-41cc-9653-cebdcdb3978e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"rg-essentials\n"
]
}
],
"source": [
" # echo $RG"
"echo $RG"
]
},
{
Expand Down Expand Up @@ -280,21 +290,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
"display_name": "Bash",
"language": "bash",
"name": "bash"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"codemirror_mode": "shell",
"file_extension": ".sh",
"mimetype": "text/x-sh",
"name": "bash"
}
},
"nbformat": 4,
Expand Down
16 changes: 12 additions & 4 deletions content/Azure/05_intro_to_cloud_storage_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"az ad signed-in-user show --query objectId -o tsv | az role assignment create \\\n",
" --role \"Storage Blob Data Contributor\" \\\n",
Expand All @@ -126,8 +128,10 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"az storage container create --account-name $STGE_ACCT --name $CTR --auth-mode login"
]
Expand Down Expand Up @@ -163,8 +167,10 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"az storage blob upload --account-name $STGE_ACCT --container-name $CTR --name demo_file --file demo_file --auth-mode login"
]
Expand Down Expand Up @@ -193,8 +199,10 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"az storage blob download --account-name $STGE_ACCT --container-name $CTR --name demo_file --file demo_file_download file --auth-mode login"
]
Expand Down
Loading

0 comments on commit 5e114ed

Please sign in to comment.