diff --git a/content/Azure/01_intro_to_cloud_console.ipynb b/content/Azure/01_intro_to_cloud_console.ipynb index 1315d3b..efa722f 100644 --- a/content/Azure/01_intro_to_cloud_console.ipynb +++ b/content/Azure/01_intro_to_cloud_console.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "dba7ad08", + "id": "976355b6", "metadata": {}, "source": [ "# Introduction to the Azure Console\n", @@ -28,36 +28,40 @@ }, { "cell_type": "markdown", - "id": "ed22965b", + "id": "61be7c43-99c1-4033-8252-6955b942bee4", "metadata": {}, "source": [ - "### Setup\n", + "## Setup\n", "\n", "The console is the point of entry where you will start your Azure journey. If you are participating in the CLASS Essentials Workshop, you will have received a csv file via email. This csv file contains your **username**, **temporary password** and **console login link**. \n", "\n", "```{admonition} Be Aware\n", ":class: danger\n", "If you are doing self-paced learning, your login information may be different!\n", - "```\n", - "\n", - "### Logging in to the console\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "f57d9cdf-8ed5-4cab-87f7-4219cb33bf2b", + "metadata": {}, + "source": [ + "## Logging in to the console\n", "Paste your console login link into your web browser. You will see the Azure site requesting your username and password. Fill in your username and password that was assigned to you in the csv file. \n", "\n", "You are now logged on. Welcome to the first step of your cloud journey! \n", "\n", - "Figure 1 is what your screen should look like 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", - "\n", + "The below is what your screen should look like 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", - "
Figure 1: Logging in to the Azure console

" + "![cloud-shell](images/azure_intro_console.jpg)" ] }, { "cell_type": "markdown", - "id": "15ee81a4", + "id": "27fc9127", "metadata": {}, "source": [ - " **1. Hamburger**\n", + "**1. 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", "\n", "**2. Search bar**\n", @@ -87,21 +91,15 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9.7" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/02_intro_to_compute.ipynb b/content/Azure/02_intro_to_compute.ipynb new file mode 100644 index 0000000..dca45b7 --- /dev/null +++ b/content/Azure/02_intro_to_compute.ipynb @@ -0,0 +1,164 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "8932d2c1", + "metadata": {}, + "source": [ + "# Introduction to Virtual Machines (VM) in Azure\n", + "\n", + "\n", + "```{admonition} Overview\n", + ":class: tip\n", + "\n", + "**Teaching:** 45 mins\n", + "\n", + "**Exercises:** 10 mins\n", + "\n", + "**Questions:**\n", + "\n", + "**Objectives:**\n", + "* Understand the concept of virtual servers.\n", + "\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "05306c25", + "metadata": {}, + "source": [ + "## Create a VM\n", + "\n", + "Hamburger in upper left -> Virtual Machines -> Create (+) in upper left -> virtual machines ->\n", + "In the middle of the page under \"Create Virtual Machine\" heading there are menu options from left to right: Basic, Disk, Networking, Management, Advanced, Tags, Review & Create\n", + "\n", + "**Part 1**\n", + "* Check subscription \n", + "* select or create Resource Group\n", + "* VM name\n", + "* Image\n", + "* Spot\n", + "* Size\n", + "\n", + "![vm-create](images/01_CLASS_Azure_VM_basic_01.png)\n", + "\n", + "**Part 2**\n", + "* Authentication type \n", + " * ssh public key\n", + "* Username\n", + " * Choose usename (default: azeruser)\n", + "* ssh public key source\n", + " * Generate new key pair\n", + "* Key pair name\n", + " * Choose name for key pair (default: auto generated based on VM name)\n", + "* Ports (none)\n", + " * Open inbound ports (default: none)\n", + "\n", + "![vm-create](images/01_CLASS_Azure_VM_basic_02.png)" + ] + }, + { + "cell_type": "markdown", + "id": "536af466", + "metadata": {}, + "source": [ + "Now let's continue to the disk configuration by clicking Next:Disk> on the bottum or on the top heading menu choose the Disk option.\n", + "\n", + "**Disk**\n", + "* OS Disk type\n", + " * Leave as default\n", + "* Encryption type\n", + " * Leave as default\n", + "* Data disk (create or attach)\n", + " * Leave as default\n", + "\n", + "![vm-disks](images/02_CLASS_Azure_VM_disks.png)\n" + ] + }, + { + "cell_type": "markdown", + "id": "007e8359", + "metadata": {}, + "source": [ + "Now let's continue to the networking configuration by clicking Next:Networking> on the bottum or on the top heading menu choose the Networking option.\n", + "\n", + "**Networking**\n", + "* Virtual network name\n", + "* Public IP\n", + " * None\n", + "* NIC network security group \n", + " * None\n", + "* Public inbound port(s)\n", + " * Allow selected port\n", + "* Select inbound port(s)\n", + " * Use 22 for ssh access\n", + "\n", + "![vm-networking](images/03_CLASS_Azure_VM_networking.png)" + ] + }, + { + "cell_type": "markdown", + "id": "1e052657", + "metadata": {}, + "source": [ + "Now let's continue to provision the VM. The next three menu options across the top are outside the scope of this tutorial so now we are ready to click Review & Create.\n", + "\n", + "**Management**\n", + "* Outside of scope\n", + "\n", + "**Advanced**\n", + "\n", + " * Outside of scope\n", + " \n", + "**Tags**\n", + "\n", + " * Outside of scope\n", + " \n", + "**Review & Create**\n", + "\n", + " * Click Review & Create \n", + " * After review you should have a green check indicating a successful validation\n", + " * Check parameters for correctness\n", + " * Click create\n", + "\n", + "When the VM is provisioned we can verify that the VM was created.\n", + "\n", + "**Verify deployment**\n", + "* Click the hamburger in the upper left\n", + "* Choose Virtual Machines\n", + "* You should see your VM name\n", + "* Click on VM name to get more information about your VM\n", + "\n", + "![vm-networking](images/04_CLASS_Azure_VM_verify.png)" + ] + }, + { + "cell_type": "markdown", + "id": "48a51891", + "metadata": {}, + "source": [ + "```{admonition} Exercise\n", + ":class: attention\n", + "\n", + "* How do Spot Instances help you optimize costs?\n", + "````" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Bash", + "language": "bash", + "name": "bash" + }, + "language_info": { + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/content/Azure/02_intro_to_compute_part1.ipynb b/content/Azure/02_intro_to_compute_part1.ipynb deleted file mode 100644 index e49623e..0000000 --- a/content/Azure/02_intro_to_compute_part1.ipynb +++ /dev/null @@ -1,182 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "dc57021c", - "metadata": {}, - "source": [ - "# Introduction to Elastic Cloud Compute (EC2)\n", - "\n", - "\n", - "```{admonition} Overview\n", - ":class: tip\n", - "\n", - "**Teaching:** 45 mins\n", - "\n", - "**Exercises:** 10 mins\n", - "\n", - "**Questions:**\n", - "* What is an EC2 instance?\n", - "* When would I use an EC2 instance?\n", - "* How do I launch an EC2 instance?\n", - "\n", - "**Objectives:**\n", - "* Understand the concept of virtual servers.\n", - "* Understand what an Elastic Cloud Compute (EC2) instance is.\n", - "\n", - "```" - ] - }, - { - "cell_type": "markdown", - "id": "502f2360", - "metadata": {}, - "source": [ - "Recall that the two fundamental components of cloud computing is compute and storage. On AWS, a \"virtual server\" or \"virtual computer\" is known as an **Elastic Cloud Compute (EC2) instance**; sometimes it's called \"EC2\", sometimes it's called an \"instance\" to denote that the ability to build and terminate this server instantaneously, but they all mean the same thing. An EC2 instance is no different from a server that sits under your desk, or your local departmental cluster, or even your local HPC cluster. You even boot up an EC2 instance through the web console, install software and then shut down your instance just like you would a real computer, except that Amazon takes care of the physical machinery while you are in charge of process of creating the computer. In some sense, you can think of utilizing an EC2 instance as renting a server or computer from Amazon! \n", - "\n", - "In cloud jargon, the term **elasticity** denotes the ability to quickly expand or decrease computer processing, memory, and storage resources to meet changing demands. In that way, you can expand the size of your CPU, RAM and disk size on your EC2 instance almost instantenously. Since EC2 forms the backbone of most of AWS's core infrastructure, it is an important part of your cloud journey. \n", - " \n", - "\n", - "Let's walk through some of the steps on getting an EC2 instance up and running. \n" - ] - }, - { - "cell_type": "markdown", - "id": "bc5d082d", - "metadata": {}, - "source": [ - "We begin with the AWS console again. Under the \"Build a Solution\" panel, select `Launch a Virtual Machine`\n", - "\n", - "\n", - "\n", - "
Figure 1: Start page for the AWS console

\n", - "\n", - "This will then lead you through a series of steps to get a **Free Tier** EC2 instance up and running. \n", - "\n", - "```{admonition} Note\n", - ":class: note\n", - "\n", - "AWS Free Tier refers to several of the services that AWS offers to help users gain more hands on experience on the AWS platform without being charged. [Click here](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all) for more info about the AWS Free Tier [external link] . \n", - "```\n", - "\n", - "There are 7 steps to walk through to create a new EC2 instance; we will go through each in detail: \n", - "1. Select an AMI\n", - "2. Choose Instance Type\n", - "3. Configure Instance \n", - "4. Add Storage\n", - "5. Add Tags\n", - "6. Configure Security Group\n", - "7. Review/Launch" - ] - }, - { - "cell_type": "markdown", - "id": "b9809503", - "metadata": {}, - "source": [ - "## 1. Select an AMI\n", - "\n", - "An Amazon Machine Image (AMI) is a template that Amazon uses to describe the operating system, disk type and all the software configuration that is needed to make sure a computer runs smoothly. Imagine that you are purchasing a new laptop; fresh out of the box, the laptop is pre-configured with an operating system (e.g. Windows, Mac OS, Ubuntu etc.), configuration files that tells the laptop what peripherals are attached, and pre-installed software like Adobe PDF reader. An AMI contains all this information so that your EC2 instance runs exactly like it would a new laptop out of the box! There is much more to learn about AMIs and how they can used for collaboration and data sharing but that is not within the scope of CLASS Essentials. \n", - "\n", - "As you scroll through the AMI list (Figure 2) you will notice that the list contains offerings from various vendors (e.g. Amazon, RedHat, Windows, etc.). We will be choosing the Ubuntu operating system for flexibility and versatility (can be used outside of the AWS ecosystem). \n", - "\n", - "To list all the Free Tier AMIs, check the box on the right that says ```Free tier only```.\n", - "\n", - "\n", - "\n", - "
Figure 2: Step 1 - Select an AMI - Free Tier Only

\n", - "\n", - "Scroll to ```Ubuntu Server 20.04 LTS(HVM), SSD Volume Type``` (Figure 3). Select ```64-bit(x86)```. \n", - "\n", - "\n", - "\n", - "
Figure 3: Step 1 - Select an AMI - Operating System Selection

" - ] - }, - { - "cell_type": "markdown", - "id": "17597535", - "metadata": {}, - "source": [ - "## Step 2: Choose an Instance Type\n", - "\n", - "Choosing an instance type is choosing the hardware for your computing system: you get to pick the number of CPUs and memory size for your instance. \n", - "\n", - "Instance types are group by [**families**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) and denotes whether, for example, an instance is optimized for batch processing (compute-optimized, C-family), optimized for databases (memory-optimized, R-family) or has accelerated hardware (GPUs) for AI or Machine Learning pipelines. \n", - "\n", - "When you choose an Instance Type (Figure 3), the screen show additional information about the selected instance type including the number of CPUs, the memory size, the type of storage and information about networking. \n", - "\n", - "In the Instance Storage (GB) column, you will notice a term called **EBS**. EBS is the acronym for **Elastic Block Storage** and is analogous to the hard disk or boot drive on your personal computer or laptop. More details about EBS and different kinds of disk storage on EC2 instances are beyond the scope of CLASS Essentials. \n", - "\n", - "```{admonition} Note\n", - ":class: note\n", - "The four most common types of storage you will encounter on AWS are: Elastic Block Storage (EBS), Elastic File Storage (EFS), Simple Storage Service (s3) and s3 Glacier. In the simplest terms, EBS is analogous to a computer hard drive and EFS is analogous to a network file system (NFS) or shared file system. s3 is AWS's object storage which is discussed [here](./intro_to_s3). s3 Glacier is a cost-effective way of storing s3 files that you do not need to access frequently. \n", - "```\n", - "\n", - "Here will will select a ```t2.micro``` instance which is Free Tier Eligible but only has 1vCPU and 1 GiB of memory. The cost of running a t2.micro instance is " - ] - }, - { - "cell_type": "markdown", - "id": "4ee655a3", - "metadata": {}, - "source": [ - "\n", - "\n", - "
Figure 3: Step 2 - Choose an Instance Type

\n", - "\n", - "Select ```Next: Configure Instance Details```.\n", - "\n", - "## Step 3: Configure Instance Details\n", - "Step 3 in creating an EC2 instance involves a rudimentary understanding of several key AWS and cloud jargon (Figure 4). While delving deeper into some of the terminology is outside of the scope of CLASS Essentials, we go will through these terms in brief as we learn how to configure your EC2 instance. \n", - "\n", - "\n", - "\n", - "
Figure 4: Step 3 - Configure Instance Details

\n", - "\n", - "**Number of instances** : This indicates how many instances you want to create at the same time. Here, we will leave the value as '1' but in actuality, you can can have up to 20 instances per region. \n", - "\n", - "```{admonition} Note\n", - ":class: note\n", - "Recall that we learned about regions in the [previous chapter](./intro_to_cloud_console). \n", - "```\n", - "\n", - "**Purchasing Options** : Throughout your AWS journey, you will hear the term [**Spot Instances**](). Spot instances make use of the servers that go unused in AWS data centers to minimize costs. Recall that AWS has many data centers spread across the globe and not all their servers are utilized at 100% capacity at all times. Amazon uses Spot Instances as a flexible way to profit from extra capacity. Users have access to Spot Instances through a bidding process, sometimes users can save up to 90% off the on-deman compute instance this way! We will not expand much more on Spot Instances in CLASS Essentials but if you are interested, I2's CLASS Intermediate talks more " - ] - }, - { - "cell_type": "markdown", - "id": "9c874bad", - "metadata": {}, - "source": [ - "```{admonition} Exercise\n", - ":class: attention\n", - "\n", - "* What kind of information is contained in an AMI? \n", - "* How do Spot Instances help you optimize costs?\n", - "````" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "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.9.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/content/Azure/03_intro_to_compute_part2.ipynb b/content/Azure/03_intro_to_compute_part2.ipynb deleted file mode 100644 index a85f0bd..0000000 --- a/content/Azure/03_intro_to_compute_part2.ipynb +++ /dev/null @@ -1,151 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "dc57021c", - "metadata": {}, - "source": [ - "# Instance Storage, Tags & Security Groups\n", - "\n", - "\n", - "```{admonition} Overview\n", - ":class: tip\n", - "\n", - "**Teaching:** 45 mins\n", - "\n", - "**Exercises:** 10 mins\n", - "\n", - "**Questions:**\n", - "* What is an EC2 instance?\n", - "* When would I use an EC2 instance?\n", - "* How do I launch an EC2 instance?\n", - "\n", - "**Objectives:**\n", - "* Understand the concept of virtual servers.\n", - "* Understand what an Elastic Cloud Compute (EC2) instance is.\n", - "\n", - "```" - ] - }, - { - "cell_type": "markdown", - "id": "502f2360", - "metadata": {}, - "source": [ - "Recall that the two fundamental components of cloud computing is compute and storage. On AWS, a \"virtual server\" or \"virtual computer\" is known as an **Elastic Cloud Compute (EC2) instance**; sometimes it's called \"EC2\", sometimes it's called an \"instance\" to denote that the ability to build and terminate this server instantaneously, but they all mean the same thing. An EC2 instance is no different from a server that sits under your desk, or your local departmental cluster, or even your local HPC cluster. You even boot up an EC2 instance through the web console, install software and then shut down your instance just like you would a real computer, except that Amazon takes care of the physical machinery while you are in charge of process of creating the computer. In some sense, you can think of utilizing an EC2 instance as renting a server or computer from Amazon! \n", - "\n", - "In cloud jargon, the term **elasticity** denotes the ability to quickly expand or decrease computer processing, memory, and storage resources to meet changing demands. In that way, you can expand the size of your CPU, RAM and disk size on your EC2 instance almost instantenously. Since EC2 forms the backbone of most of AWS's core infrastructure, it is an important part of your cloud journey. \n", - " \n", - "\n", - "Let's walk through some of the steps on getting an EC2 instance up and running. \n" - ] - }, - { - "cell_type": "markdown", - "id": "bc5d082d", - "metadata": {}, - "source": [ - "We begin with the AWS console again. Under the \"Build a Solution\" panel, select `Launch a Virtual Machine`\n", - "\n", - "\n", - "\n", - "
Figure 1: Start page for the AWS console

\n", - "\n", - "This will then lead you through a series of steps to get a **Free Tier** EC2 instance up and running. \n", - "\n", - "```{admonition} Note\n", - ":class: note\n", - "\n", - "AWS Free Tier refers to several of the services that AWS offers to help users gain more hands on experience on the AWS platform without being charged. [Click here](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all) for more info about the AWS Free Tier [external link] . \n", - "```\n", - "\n", - "There are 7 steps to walk through to create a new EC2 instance; we will go through each in detail: \n", - "1. Select an AMI\n", - "2. Choose Instance Type\n", - "3. Configure Instance \n", - "4. Add Storage\n", - "5. Add Tags\n", - "6. Configure Security Group\n", - "7. Review/Launch" - ] - }, - { - "cell_type": "markdown", - "id": "b9809503", - "metadata": {}, - "source": [ - "## 1. Select an AMI\n", - "\n", - "An Amazon Machine Image (AMI) is a template that Amazon uses to describe the operating system, disk type and all the software configuration that is needed to make sure a computer runs smoothly. Imagine that you are purchasing a new laptop; fresh out of the box, the laptop is pre-configured with an operating system (e.g. Windows, Mac OS, Ubuntu etc.), configuration files that tells the laptop what peripherals are attached, and pre-installed software like Adobe PDF reader. An AMI contains all this information so that your EC2 instance runs exactly like it would a new laptop out of the box! There is much more to learn about AMIs and how they can used for collaboration and data sharing but that is not within the scope of CLASS Essentials. \n", - "\n", - "As you scroll through the AMI list (Figure 2) you will notice that the list contains offerings from various vendors (e.g. Amazon, RedHat, Windows, etc.). We will be choosing the Ubuntu operating system for flexibility and versatility (can be used outside of the AWS ecosystem). \n", - "\n", - "To list all the Free Tier AMIs, check the box on the right that says ```Free tier only```.\n", - "\n", - "\n", - "\n", - "
Figure 2: Step 1 - Select an AMI - Free Tier Only

\n", - "\n", - "Scroll to ```Ubuntu Server 20.04 LTS(HVM), SSD Volume Type``` (Figure 3). Select ```64-bit(x86)```. \n", - "\n", - "\n", - "\n", - "
Figure 3: Step 1 - Select an AMI - Operating System Selection

" - ] - }, - { - "cell_type": "markdown", - "id": "17597535", - "metadata": {}, - "source": [ - "## Step 2: Choose an Instance Type\n", - "\n", - "Choosing an instance type is choosing the hardware for your computing system: you get to pick the number of CPUs and memory size for your instance. \n", - "\n", - "Instance types are group by [**families**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) and denotes whether, for example, an instance is optimized for batch processing (compute-optimized, C-family), optimized for databases (memory-optimized, R-family) or has accelerated hardware (GPUs) for AI or Machine Learning pipelines. \n", - "\n", - "When you choose an Instance Type (Figure 3), the screen show additional information about the selected instance type including the number of CPUs, the memory size, the type of storage and information about networking. \n", - "\n", - "In the Instance Storage (GB) column, you will notice a term called **EBS**. EBS is the acronym for **Elastic Block Storage** and is analogous to the hard disk or boot drive on your personal computer or laptop. More details about EBS and different kinds of disk storage on EC2 instances are beyond the scope of CLASS Essentials. \n", - "\n", - "```{admonition} Note\n", - ":class: note\n", - "The four most common types of storage you will encounter on AWS are: Elastic Block Storage (EBS), Elastic File Storage (EFS), Simple Storage Service (s3) and s3 Glacier. In the simplest terms, EBS is analogous to a computer hard drive and EFS is analogous to a network file system (NFS) or shared file system. s3 is AWS's object storage which is discussed [here](./intro_to_s3). s3 Glacier is a cost-effective way of storing s3 files that you do not need to access frequently. \n", - "```\n" - ] - }, - { - "cell_type": "markdown", - "id": "4ee655a3", - "metadata": {}, - "source": [ - "\n", - "\n", - "
Figure 3: Step 2 - Choose an Instance Type

\n", - "\n", - "Select ```Next: Configure Instance Details``` and we'll move on to the next chapter. " - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "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.9.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/content/Azure/04_intro_to_cli.ipynb b/content/Azure/04_intro_to_cli.ipynb index 2dec232..46c1fac 100644 --- a/content/Azure/04_intro_to_cli.ipynb +++ b/content/Azure/04_intro_to_cli.ipynb @@ -5,7 +5,7 @@ "id": "bfb78c2d", "metadata": {}, "source": [ - "## Navigating the Command Line Interface (CLI)\n", + "# Navigating the Command Line Interface (CLI)\n", "\n", "Learner Questions\n", " * How do I use the Cloud CLI?\n", @@ -25,7 +25,7 @@ "id": "e8cda207", "metadata": {}, "source": [ - "### Open the Cloud Shell\n", + "## Open the Cloud Shell\n", "\n", "The Cloud Shell is Debian running in a container with 5GB of no-charge persistent storage with most of the Azure tools and a lot of other useful tools (git, docker, jq, Docker, etc.) installed by default.\n", "\n", @@ -41,7 +41,7 @@ "id": "1799e8dd", "metadata": {}, "source": [ - "### Exercise\n", + "## Exercise\n", "Take a couple of minutes to explore your new Cloud Shell environment.\n", " * How much RAM is available?\n", " * How much storage is available to you?\n", @@ -54,51 +54,13 @@ "id": "da18d22e", "metadata": {}, "source": [ - "### Basic Cloud Commands\n", + "## Basic Cloud Commands\n", "\n", "The cloud can also be controlled using a command line interface (CLI) or a programming language such as Python. Collectively these tools interact with the cloud over a Application Programming Interface (API) and this capability forms the basis of the cloud, the ability to control infrastructure programmatically. \n", "\n", - "For information about installing the Azure CLI for your OS see: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli\n", + "For information about installing the Azure CLI for your OS see: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli. If you are on your own OS you will need to login via `az login`.\n", "\n", - "The `az` command is used to control most aspects of Azure Cloud.\n", - "\n", - "First we need to login:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1dff69af", - "metadata": {}, - "outputs": [], - "source": [ - "az login -u -p " - ] - }, - { - "cell_type": "markdown", - "id": "d7c44428", - "metadata": {}, - "source": [ - "If you want to avoid displaying your password on console and are using az login interactively, use the read -s command under bash." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3710322e", - "metadata": {}, - "outputs": [], - "source": [ - "read -sp \"Azure password: \" AZ_PASS && echo && az login -u -p $AZ_PASS" - ] - }, - { - "cell_type": "markdown", - "id": "a0ac6e65", - "metadata": {}, - "source": [ - "or you can just use \"az login\" by itself and your default web browser will open a login window." + "The `az` command is used to control most aspects of Azure Cloud." ] }, { @@ -106,12 +68,12 @@ "id": "f7b90dba", "metadata": {}, "source": [ - "Now let us look at your account information. " + "Now let us look at your account information (your details will be different). " ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "27170c24", "metadata": {}, "outputs": [ @@ -119,41 +81,27 @@ "name": "stdout", "output_type": "stream", "text": [ - "[\r\n", - " {\r\n", - " \"cloudName\": \"AzureCloud\",\r\n", - " \"homeTenantId\": \"67f4c504-a061-436d-ba6c-7a0fb76f6df8\",\r\n", - " \"id\": \"194bf392-269d-45de-89fc-ea9c8369fb94\",\r\n", - " \"isDefault\": false,\r\n", - " \"managedByTenants\": [],\r\n", - " \"name\": \"Azure subscription 1\",\r\n", - " \"state\": \"Enabled\",\r\n", - " \"tenantId\": \"67f4c504-a061-436d-ba6c-7a0fb76f6df8\",\r\n", - " \"user\": {\r\n", - " \"name\": \"1968posch912@gmail.com\",\r\n", - " \"type\": \"user\"\r\n", - " }\r\n", - " },\r\n", - " {\r\n", - " \"cloudName\": \"AzureCloud\",\r\n", - " \"homeTenantId\": \"78ea4b46-9f08-4ef5-949b-2dae057c55d8\",\r\n", - " \"id\": \"ae186240-1b93-42b5-bb33-e9b8c4e527de\",\r\n", - " \"isDefault\": true,\r\n", - " \"managedByTenants\": [],\r\n", - " \"name\": \"rece-dev\",\r\n", - " \"state\": \"Enabled\",\r\n", - " \"tenantId\": \"78ea4b46-9f08-4ef5-949b-2dae057c55d8\",\r\n", - " \"user\": {\r\n", - " \"name\": \"jhicks@internet2.edu\",\r\n", - " \"type\": \"user\"\r\n", - " }\r\n", - " }\r\n", - "]\r\n" + "[\n", + " {\n", + " \"cloudName\": \"AzureCloud\",\n", + " \"id\": \"975b9702-e6b9-47b5-94a5-ca5f2b110ca8\",\n", + " \"isDefault\": true,\n", + " \"name\": \"class-dev\",\n", + " \"state\": \"Enabled\",\n", + " \"tenantId\": \"78ea4b46-9f08-4ef5-949b-2dae057c55d8\",\n", + " \"user\": {\n", + " \"assignedIdentityInfo\": \"MSI\",\n", + " \"name\": \"systemAssignedIdentity\",\n", + " \"type\": \"servicePrincipal\"\n", + " }\n", + " }\n", + "]\n", + "\u001b[0m" ] } ], "source": [ - "!az account list" + "az account list" ] }, { @@ -161,7 +109,7 @@ "id": "cd6323ad", "metadata": {}, "source": [ - "### Environment Variables\n", + "## Environment Variables\n", "\n", "When using the CLI you quickly notice that you have to enter many of the details, such as a Resource Group, many times. Not only is this tedious, it also makes moving to another project difficult making reusability and collaboration painful. We will demonstrate the use environment variables to address these issues. As a reminder, environment variables used to store configuration information that can be easily passed between programs and programming languages. Most cloud environments and tools rely heavily on this technique.\n", "\n", @@ -170,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "id": "b8f74fe9-0943-4bd9-a91b-da09c001f8a1", "metadata": {}, "outputs": [], @@ -180,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "id": "b937f6c7-3697-4bc0-8e32-da0b0faec593", "metadata": {}, "outputs": [ @@ -208,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "id": "bae0587c-0379-40e3-9c31-16ba5505487a", "metadata": {}, "outputs": [ @@ -216,7 +164,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "student31\n" + "learner\n" ] } ], @@ -226,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "id": "52b4add5-0d18-4faf-a304-b7e0ee8ba82e", "metadata": {}, "outputs": [ @@ -234,7 +182,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "cs-730348008320-default-default-kp946\n" + "essentials\n" ] } ], @@ -242,6 +190,14 @@ "echo \"${HOSTNAME}\"" ] }, + { + "cell_type": "markdown", + "id": "0be0c5dc-8f65-4749-a56b-f47bbdeb6106", + "metadata": {}, + "source": [ + "If you are using the cloudshell then your hostname will look similar to `cc-2510c465-7677c9dc4c-fcl8k`" + ] + }, { "cell_type": "markdown", "id": "ef895f38-ad16-4f2d-aa18-ec913732dd69", @@ -252,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "id": "776806e4-209f-45fa-b14e-f771f5d5089d", "metadata": {}, "outputs": [ @@ -260,7 +216,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Tue 24 Aug 2021 03:15:21 PM UTC\n" + "Thu Dec 2 17:16:22 UTC 2021\n" ] } ], @@ -270,7 +226,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 7, "id": "560fde63-0eb8-4c52-9787-4debfe35ec23", "metadata": {}, "outputs": [ @@ -278,12 +234,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "Date: Mon Sep 27 16:49:24 EDT 2021\r\n" + "Date: Thu Dec 2 17:16:23 UTC 2021\n" ] } ], "source": [ - "!echo \"Date: $(date)\"" + "echo \"Date: $(date)\"" ] }, { @@ -308,18 +264,18 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 8, "id": "d00a37e4", "metadata": {}, "outputs": [], "source": [ - "MYRG=\"MyResourceGroup\"\n", + "RG=\"rg-essentials\"\n", "REGION=\"eastus\"" ] }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 9, "id": "d7988c45", "metadata": {}, "outputs": [ @@ -327,17 +283,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "MyResourceGroup\r\n" + "rg-essentials\n" ] } ], "source": [ - "!echo $MYRG" + "echo $RG" ] }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 13, "id": "49f484a6", "metadata": {}, "outputs": [ @@ -345,22 +301,23 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\r\n", - " \"id\": \"/subscriptions/ae186240-1b93-42b5-bb33-e9b8c4e527de/resourceGroups/MyResourceGroup\",\r\n", - " \"location\": \"eastus\",\r\n", - " \"managedBy\": null,\r\n", - " \"name\": \"MyResourceGroup\",\r\n", - " \"properties\": {\r\n", - " \"provisioningState\": \"Succeeded\"\r\n", - " },\r\n", - " \"tags\": null,\r\n", - " \"type\": \"Microsoft.Resources/resourceGroups\"\r\n", - "}\r\n" + "{\n", + " \"id\": \"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/rg-essentials\",\n", + " \"location\": \"eastus\",\n", + " \"managedBy\": null,\n", + " \"name\": \"rg-essentials\",\n", + " \"properties\": {\n", + " \"provisioningState\": \"Succeeded\"\n", + " },\n", + " \"tags\": null,\n", + " \"type\": \"Microsoft.Resources/resourceGroups\"\n", + "}\n", + "\u001b[0m" ] } ], "source": [ - "!az group create --name $MYRG --location $REGION" + "az group create --name $RG --location $REGION" ] }, { @@ -368,12 +325,12 @@ "id": "7fe71e66", "metadata": {}, "source": [ - "Now use the `MYRG` envrionment variable to get information about your RG. This information is available at any time with the following command not just at creation." + "Now use the `RG` environment variable to get information about your resource group. This information is available at any time with the following command not just at creation." ] }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 14, "id": "31b01f78-94b1-44f0-a2af-d657058941b2", "metadata": {}, "outputs": [ @@ -381,22 +338,23 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\r\n", - " \"id\": \"/subscriptions/ae186240-1b93-42b5-bb33-e9b8c4e527de/resourceGroups/MyResourceGroup\",\r\n", - " \"location\": \"eastus\",\r\n", - " \"managedBy\": null,\r\n", - " \"name\": \"MyResourceGroup\",\r\n", - " \"properties\": {\r\n", - " \"provisioningState\": \"Succeeded\"\r\n", - " },\r\n", - " \"tags\": null,\r\n", - " \"type\": \"Microsoft.Resources/resourceGroups\"\r\n", - "}\r\n" + "{\n", + " \"id\": \"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/rg-essentials\",\n", + " \"location\": \"eastus\",\n", + " \"managedBy\": null,\n", + " \"name\": \"rg-essentials\",\n", + " \"properties\": {\n", + " \"provisioningState\": \"Succeeded\"\n", + " },\n", + " \"tags\": null,\n", + " \"type\": \"Microsoft.Resources/resourceGroups\"\n", + "}\n", + "\u001b[0m" ] } ], "source": [ - "!az group show --resource-group $MYRG" + "az group show --resource-group $RG" ] }, { @@ -404,7 +362,8 @@ "id": "270e0abb-d5e9-476a-af91-060cc0ea0349", "metadata": {}, "source": [ - "### Exercise\n", + "## Exercise\n", + "FIXME:\n", " * What command shows the project number? (hint: we used it already)\n", " * What is the name of this variable? (hint: it is case sensitive)\n", " * What command shows *just* the Project Number (hint: use `--format`)\n", @@ -412,20 +371,18 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "id": "b9eebea3", + "cell_type": "markdown", + "id": "3b744cd4-3c7e-43f2-83ae-0ff02ec9de83", "metadata": {}, - "outputs": [], "source": [ - "### Advanced Call-Out: Formating Output.\n", + "## Advanced Call-Out: Formating Output.\n", "\n", "The following example shows how to output the configuration as `JSON`." ] }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 18, "id": "678a1735-8cad-403c-b302-639de1fb0f4b", "metadata": { "tags": [] @@ -435,66 +392,71 @@ "name": "stdout", "output_type": "stream", "text": [ - "[\r\n", - " {\r\n", - " \"id\": \"/subscriptions/ae186240-1b93-42b5-bb33-e9b8c4e527de/resourceGroups/cloud-shell-storage-eastus\",\r\n", - " \"location\": \"eastus\",\r\n", - " \"managedBy\": null,\r\n", - " \"name\": \"cloud-shell-storage-eastus\",\r\n", - " \"properties\": {\r\n", - " \"provisioningState\": \"Succeeded\"\r\n", - " },\r\n", - " \"tags\": null,\r\n", - " \"type\": \"Microsoft.Resources/resourceGroups\"\r\n", - " },\r\n", - " {\r\n", - " \"id\": \"/subscriptions/ae186240-1b93-42b5-bb33-e9b8c4e527de/resourceGroups/NetworkWatcherRG\",\r\n", - " \"location\": \"eastus\",\r\n", - " \"managedBy\": null,\r\n", - " \"name\": \"NetworkWatcherRG\",\r\n", - " \"properties\": {\r\n", - " \"provisioningState\": \"Succeeded\"\r\n", - " },\r\n", - " \"tags\": null,\r\n", - " \"type\": \"Microsoft.Resources/resourceGroups\"\r\n", - " },\r\n", - " {\r\n", - " \"id\": \"/subscriptions/ae186240-1b93-42b5-bb33-e9b8c4e527de/resourceGroups/MyResourceGroup\",\r\n", - " \"location\": \"eastus\",\r\n", - " \"managedBy\": null,\r\n", - " \"name\": \"MyResourceGroup\",\r\n", - " \"properties\": {\r\n", - " \"provisioningState\": \"Succeeded\"\r\n", - " },\r\n", - " \"tags\": null,\r\n", - " \"type\": \"Microsoft.Resources/resourceGroups\"\r\n", - " }\r\n", - "]\r\n" + "\u001b[1;39m[\n", + " \u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"id\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/cloudshell\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"location\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"centralus\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"managedBy\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"cloudshell\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"properties\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"provisioningState\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Succeeded\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"tags\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"type\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Microsoft.Resources/resourceGroups\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"id\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/rg-essentials-dev\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"location\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"centralus\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"managedBy\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"rg-essentials-dev\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"properties\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"provisioningState\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Succeeded\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"tags\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"type\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Microsoft.Resources/resourceGroups\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"id\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/NetworkWatcherRG\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"location\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"eastus\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"managedBy\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"NetworkWatcherRG\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"properties\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"provisioningState\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Succeeded\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"tags\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"type\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Microsoft.Resources/resourceGroups\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"id\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"/subscriptions/975b9702-e6b9-47b5-94a5-ca5f2b110ca8/resourceGroups/rg-essentials\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"location\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"eastus\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"managedBy\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"rg-essentials\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"properties\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", + " \u001b[0m\u001b[34;1m\"provisioningState\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Succeeded\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"tags\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;30mnull\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"type\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Microsoft.Resources/resourceGroups\"\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", + "\u001b[1;39m]\u001b[0m\n" ] } ], "source": [ - "!az group list --output json" + "az group list --output json | jq" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.9.7" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/05_intro_to_cloud_storage.ipynb b/content/Azure/05_intro_to_cloud_storage.ipynb index f3f90ef..eaa38c6 100644 --- a/content/Azure/05_intro_to_cloud_storage.ipynb +++ b/content/Azure/05_intro_to_cloud_storage.ipynb @@ -2,57 +2,195 @@ "cells": [ { "cell_type": "markdown", - "id": "dc57021c", + "id": "677549a8", "metadata": {}, "source": [ - "# Introduction to Cloud Storage\n", + "# Introduction to Azure Cloud Storage\n", "\n", + "Learner Questions\n", + " * How do I store data in the cloud?\n", "\n", - "```{admonition} Overview\n", - ":class: tip\n", + "Learning Objectives:\n", + " * Navigate the Azure Cloud Storage service and terminology\n", + " * Understand the roles and permissions needed to use Azure Cloud Storage\n", + " * Allocate storage in Azure Cloud Storage account\n", + " * Allocate storage in Azure Cloud Storage\n", + " * De-allocate Azure Cloud Storage storage" + ] + }, + { + "cell_type": "markdown", + "id": "09e26920", + "metadata": {}, + "source": [ + "Drew, after working with a Research Computing and Data (RCD) facilitator, has decided to continue his cloud journey with storage.\n", + "\n", + "One of the most common and economic ways to store data in the cloud is to use object storage.\n" + ] + }, + { + "cell_type": "markdown", + "id": "d46f786b", + "metadata": { + "tags": [] + }, + "source": [ + "## Azure Cloud Storage\n", + "\n", + "To learn more about the Azure blob Storage service we will use the web console to create, explore, and destroy a storage container. The ability to quickly create, explore, and then discard resources in the web-console is a powerful tool to explore a service. After an initial exploration with the web-console, programmatic access using scripts and programming languages should be used.\n", "\n", + "Unfortunately, the terminology used for object storage differs from one commercial cloud provider to another. Azure uses the terms Storage Container. Data is stored in Objects and Objects are stored in Containers. Objects (data) are stored as a key-value pair, which is similar to a Python dictionary but persistent. Values are stored and retrieved using a unique key and the value can contain any information (more on this later).\n", "\n", - "```" + "We now take Drew through the process of creating a Google Cloud Storage bucket." ] }, { "cell_type": "markdown", - "id": "502f2360", + "id": "89b2cc65", + "metadata": { + "tags": [] + }, + "source": [ + "### Security (Still need to update for Azure)\n", + "\n", + "Everything in the cloud requires permission (authorization). Let's first verify that we have the permissions to create a bucket. A Bucket (a resource) is created within a project and inheres permissions from it.\n", + "\n", + "We are interested in what permissions that *your* account has for *your* project. To do this navigate to the IAM page (**Navigation Menu -> IAM & Admin -> IAM -> Permissions -> View By: Principals**). This shows the permissions for the project.\n", + "\n", + "*Note: There is a powerful filter box to limit the permissions shown.*\n", + "\n", + "You should see a row with your account shown in the Principal column. Here you should see the \"Owner\" Role in the Role column. A *role* is a collection of permissions managed by Google or someone else. The **Owner** or the **Storage Admin** role for a project will *allow* *you* to create, access, and delete Buckets *in* the project.\n", + "\n", + "There are three important pieces of information that work together to form the **IAM policy**. The permission (role), the identity (principal or member), and the resource (project)." + ] + }, + { + "cell_type": "markdown", + "id": "3e396a67", "metadata": {}, "source": [ - "```{code-cell} ipython3\n", - ":tags: [mytag]\n", + "### Create Resource Group (Note sure if this is needed)\n", "\n", - "print(\"A python cell\")\n", - "```" + "Alocating any resource in Azure requires a Resource Goup. Resources Groups scope your resources under a common entity for \n", + "resource interaction, IAM, billing (technically subsription but a resource group is under a subscription), ..., etc. \n", + "\n", + "* Navigate to Resource Groups\n", + "* Click \"+ create\" in the upper left \n", + "* Select a name for your Resource Group\n", + "* Leave the rest as default\n", + "* Click Review & Create\n", + "* After passing validation, click create\n" ] }, { - "cell_type": "code", - "execution_count": null, - "id": "c543528f", + "cell_type": "markdown", + "id": "4a8f2f30", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "### Create storage account\n", + "\n", + "Like all things in Azure you will need an account to manage your service. In this case we need a storage account. To create a storage account, follow these steps.\n", + "\n", + "* Navigate to storage accounts\n", + "* Click \"+ create\" in the upper left \n", + "\n", + "![vm-create-storage](images/04_azure_create_storage_account.png)\n", + "\n", + "* Select (or create) a Resource Group\n", + "* Select a name for your Storage account\n", + "* Leave the rest as default\n", + "* Click Review & Create\n", + "\n", + "![vm-create-storage-account](images/04_azure_storage_account_create_name.png)\n", + "\n", + "* After passing validation, click create\n", + "* The page will indicate when the account has been deployed. Click on \"go to resource\"\n", + "\n", + "![vm-create-finished](images/04_azure_storage_account_finished_page.png)\n" + ] + }, + { + "cell_type": "markdown", + "id": "4860da70", + "metadata": { + "tags": [] + }, + "source": [ + "### Allocate Azure Cloud Storage\n", + "\n", + "To create a blob storage container in the Azure portal, follow these steps:\n", + "\n", + "* Navigate to your new storage account in the Azure portal.\n", + "* In the left menu for the storage account, scroll to the Data storage section, then select containers.\n", + "* Select the + Container button.\n", + "* Type a name for your new container.\n", + "* Select OK to create the container.\n", + "\n", + "![vm-create-container](images/04_azure_storage_create_container.png)\n" + ] + }, + { + "cell_type": "markdown", + "id": "d7bdd31c", + "metadata": {}, + "source": [ + "**Now click on the container**\n", + "* This is where your blob objects can be viewed, uploaded, downloaded, & deleted.\n", + "* Click \"Upload\"\n", + "* In the Upload blob menu, either type in a file name or click on the icon to the right to browse your local filesystem.\n", + "* Choose a file from your local filesystem\n", + "* click upload" + ] + }, + { + "cell_type": "markdown", + "id": "21adbab1", + "metadata": { + "tags": [] + }, + "source": [ + "### Enumerate the Buckets\n", + "\n", + "Now lets find and examine the bucket. To view a bucket we do the following:\n", + "\n", + "* Navigate to Storage Accounts in the Azure portal and select your new storage account.\n", + "* In your storage account select containers\n", + "* Under containers you should see the container you created in the previous step\n", + "* This verifies that a storage container was deployed\n" + ] + }, + { + "cell_type": "markdown", + "id": "9f28062e", + "metadata": { + "tags": [] + }, + "source": [ + "### Delete the Storage\n", + "\n", + "To complete the resource life-cycle we simply delete the storage container created in this lesson. All blobs in the container will also be deleted. This will leave you with a storage account that can be used again for additional stoarge services.\n", + "\n", + "To delete the container:\n", + "\n", + "* In the Azure portal, navigate to the list of containers in your storage account.\n", + "* Select the container to delete.\n", + "* Select the More button (...), and select Delete.\n", + "* Confirm that you want to delete the container.\n", + "\n" + ] } ], "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.9.5" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/06_running_analysis.ipynb b/content/Azure/06_running_analysis.ipynb index a6ca11e..a0ec478 100644 --- a/content/Azure/06_running_analysis.ipynb +++ b/content/Azure/06_running_analysis.ipynb @@ -11,48 +11,29 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", + "**Teaching:**\n", "\n", - "```" - ] - }, - { - "cell_type": "markdown", - "id": "502f2360", - "metadata": {}, - "source": [ - "```{code-cell} ipython3\n", - ":tags: [mytag]\n", + "**Exercises:**\n", + "\n", + "**Questions:**\n", + "\n", + "**Objectives:**\n", "\n", - "print(\"A python cell\")\n", "```" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c543528f", - "metadata": {}, - "outputs": [], - "source": [] } ], "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.9.5" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/07_monitoring_costs.ipynb b/content/Azure/07_monitoring_costs.ipynb index c8b0712..0c280fa 100644 --- a/content/Azure/07_monitoring_costs.ipynb +++ b/content/Azure/07_monitoring_costs.ipynb @@ -11,48 +11,30 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", + "**Teaching:**\n", + "\n", + "**Exercises:**\n", + "\n", + "**Questions:**\n", + "\n", + "**Objectives:**\n", "\n", - "```" - ] - }, - { - "cell_type": "markdown", - "id": "502f2360", - "metadata": {}, - "source": [ - "```{code-cell} ipython3\n", - ":tags: [mytag]\n", "\n", - "print(\"A python cell\")\n", "```" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c543528f", - "metadata": {}, - "outputs": [], - "source": [] } ], "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.9.5" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/08_cleaning_up_resources.ipynb b/content/Azure/08_cleaning_up_resources.ipynb index d1604da..52b682f 100644 --- a/content/Azure/08_cleaning_up_resources.ipynb +++ b/content/Azure/08_cleaning_up_resources.ipynb @@ -11,48 +11,115 @@ "```{admonition} Overview\n", ":class: tip\n", "\n", + "**Teaching:**\n", + "\n", + "**Exercises:**\n", + "\n", + "**Questions:**\n", + "\n", + "**Objectives:**\n", "\n", "```" ] }, { "cell_type": "markdown", - "id": "502f2360", + "id": "1377081d-7da5-4088-8ba9-966f297af1d6", "metadata": {}, "source": [ - "```{code-cell} ipython3\n", - ":tags: [mytag]\n", + "## Remove Resource Group\n", "\n", - "print(\"A python cell\")\n", - "```" + "Removing a resource group removes all the resources associated with the resource group.\n", + "\n", + "**WARNING: This will remove all resources (virtual machines, storage buckets, etc.) from the `rg-essentials` resource group!**" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "7a134850-8c4f-47c6-9816-6d487a88eda1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rg-essentials\n" + ] + } + ], + "source": [ + "RG=rg-essentials\n", + "echo $RG" + ] + }, + { + "cell_type": "markdown", + "id": "826bc0e0-545c-46e3-9ede-aa7663754b76", + "metadata": {}, + "source": [ + "List resources we will be deleting (not exclusive) when the resource group is deleted." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "6ccd79ab-0068-4a2a-9aca-2c47454f9d85", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\u001b[0m" + ] + } + ], + "source": [ + "az vm list --resource-group $RG --output table" + ] + }, + { + "cell_type": "markdown", + "id": "8ada5056-3963-4ca0-9250-ac0e6dc8aba8", + "metadata": {}, + "source": [ + "Remove Resource Group. Note, this will take many seconds.\n", + "\n", + "**WARNING: This will remove all resources (virtual machines, storage buckets, etc.) from the `rg-essentials` resource group!**" ] }, { "cell_type": "code", - "execution_count": null, - "id": "c543528f", + "execution_count": 9, + "id": "3ff9bb93-aadf-4319-aed4-b5fc1f2518c8", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[K\u001b[0minished .." + ] + } + ], + "source": [ + "az group delete --resource-group $RG --yes" + ] } ], "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.9.5" + "codemirror_mode": "shell", + "file_extension": ".sh", + "mimetype": "text/x-sh", + "name": "bash" } }, "nbformat": 4, diff --git a/content/Azure/images/01_CLASS_Azure_VM_basic_01.png b/content/Azure/images/01_CLASS_Azure_VM_basic_01.png new file mode 100644 index 0000000..0d8a3ed Binary files /dev/null and b/content/Azure/images/01_CLASS_Azure_VM_basic_01.png differ diff --git a/content/Azure/images/01_CLASS_Azure_VM_basic_02.png b/content/Azure/images/01_CLASS_Azure_VM_basic_02.png new file mode 100644 index 0000000..9606ff3 Binary files /dev/null and b/content/Azure/images/01_CLASS_Azure_VM_basic_02.png differ diff --git a/content/Azure/images/02_CLASS_Azure_VM_disks.png b/content/Azure/images/02_CLASS_Azure_VM_disks.png new file mode 100644 index 0000000..4ffa485 Binary files /dev/null and b/content/Azure/images/02_CLASS_Azure_VM_disks.png differ diff --git a/content/Azure/images/03_CLASS_Azure_VM_networking.png b/content/Azure/images/03_CLASS_Azure_VM_networking.png new file mode 100644 index 0000000..b88f40c Binary files /dev/null and b/content/Azure/images/03_CLASS_Azure_VM_networking.png differ diff --git a/content/Azure/images/04_CLASS_Azure_VM_verify.png b/content/Azure/images/04_CLASS_Azure_VM_verify.png new file mode 100644 index 0000000..4a192d6 Binary files /dev/null and b/content/Azure/images/04_CLASS_Azure_VM_verify.png differ diff --git a/content/Azure/images/04_azure_create_storage_account.png b/content/Azure/images/04_azure_create_storage_account.png new file mode 100644 index 0000000..7e26861 Binary files /dev/null and b/content/Azure/images/04_azure_create_storage_account.png differ diff --git a/content/Azure/images/04_azure_storage_account_create_name.png b/content/Azure/images/04_azure_storage_account_create_name.png new file mode 100644 index 0000000..507543d Binary files /dev/null and b/content/Azure/images/04_azure_storage_account_create_name.png differ diff --git a/content/Azure/images/04_azure_storage_account_finished_page.png b/content/Azure/images/04_azure_storage_account_finished_page.png new file mode 100644 index 0000000..fffdd18 Binary files /dev/null and b/content/Azure/images/04_azure_storage_account_finished_page.png differ diff --git a/content/Azure/images/04_azure_storage_blob_list.png b/content/Azure/images/04_azure_storage_blob_list.png new file mode 100644 index 0000000..69c8376 Binary files /dev/null and b/content/Azure/images/04_azure_storage_blob_list.png differ diff --git a/content/Azure/images/04_azure_storage_choose_file.png b/content/Azure/images/04_azure_storage_choose_file.png new file mode 100644 index 0000000..e530225 Binary files /dev/null and b/content/Azure/images/04_azure_storage_choose_file.png differ diff --git a/content/Azure/images/04_azure_storage_create_container.png b/content/Azure/images/04_azure_storage_create_container.png new file mode 100644 index 0000000..0be9c08 Binary files /dev/null and b/content/Azure/images/04_azure_storage_create_container.png differ diff --git a/content/Azure/images/Azure_perfSONAR.png b/content/Azure/images/Azure_perfSONAR.png new file mode 100644 index 0000000..c301558 Binary files /dev/null and b/content/Azure/images/Azure_perfSONAR.png differ diff --git a/content/Azure/images/Azure_perfSONAR_container.png b/content/Azure/images/Azure_perfSONAR_container.png new file mode 100644 index 0000000..aaa2005 Binary files /dev/null and b/content/Azure/images/Azure_perfSONAR_container.png differ diff --git a/content/Azure/images/Azure_perfSONAR_initial_network.png b/content/Azure/images/Azure_perfSONAR_initial_network.png new file mode 100644 index 0000000..723bebc Binary files /dev/null and b/content/Azure/images/Azure_perfSONAR_initial_network.png differ diff --git a/content/Azure/images/acceleratescience.svg b/content/Azure/images/acceleratescience.svg new file mode 100644 index 0000000..6985786 --- /dev/null +++ b/content/Azure/images/acceleratescience.svg @@ -0,0 +1 @@ +WILL CLOUD COMPUTING HELP ACCELERATE MYSCIENTIFIC DISCOVERY?Local computeresources taketoo longPersonalcomputersrun of memory orCPUNeed scalablecomputingComputational ProblemCommondatasets are hosted onthe cloudCollaborators arealready using thecloudInterestedinreproduciblescienceExternal motivationDo youalready havecloudcredits?Do you useproprietary softwarethat requires a operatingsystem?Whichprovider doyourcollaboratorsuse?choosing a cloud providerAre theredata securityand privacyconcerns?Do you haveresources toadapt to a cloud-native if necessary?Do you needto make dataavailable for'x' amount ofyears?further assessmentIn your assessment of whether or not your research will from using the cloud, you need to be aware that there is an associated learning curve and a set of bestpractices that you are encouraged to follow! \ No newline at end of file diff --git a/content/Azure/images/azure_intro_console.jpg b/content/Azure/images/azure_intro_console.jpg new file mode 100644 index 0000000..c3cd325 Binary files /dev/null and b/content/Azure/images/azure_intro_console.jpg differ diff --git a/content/Azure/images/azure_storage_account.png b/content/Azure/images/azure_storage_account.png new file mode 100644 index 0000000..133b409 Binary files /dev/null and b/content/Azure/images/azure_storage_account.png differ diff --git a/content/Azure/images/classprogram.svg b/content/Azure/images/classprogram.svg new file mode 100644 index 0000000..36bba0a --- /dev/null +++ b/content/Azure/images/classprogram.svg @@ -0,0 +1 @@ +CLASS CORECLASS ESSENTIALSCLASS INTERMEDIATECLASS ADVANCEDUnderstanding the why and when of using the cloud forresearch computingUnderstanding the howsof using the cloud for research computingUnderstanding the hows and whens and whats of using the cloud for research computingPutting together all the plumbing to help researchers arrive  at a solution!THE INTERNET2 CLASS PROGRAMHELPING ACCELERATE SCIENTIFICDISCOVERY ON THE CLOUDAN END TO END FRAMEWORK FOR CLOUD ADOPTION!- Cloud neutral solutions- Hands-on, experiential learning- Build a community of practice- Developed by researchers for researchers! \ No newline at end of file diff --git a/content/Azure/images/cloudcomponents.svg b/content/Azure/images/cloudcomponents.svg new file mode 100644 index 0000000..ec8d99d --- /dev/null +++ b/content/Azure/images/cloudcomponents.svg @@ -0,0 +1 @@ +Compute Virtual Machines or "instances" that come with a pre-determined compute power, memoryand operating system. These compute systems canrange from small to powerful.storageStorage options range from "hot" (e.g.imagine yourlocal hard drive) to "cold" i.e. archival. Costsare often decreasing.Storage and compute often gohand in hand for data analysis. data Data on the cloud can be stored in databases ordata warehouses as a service and these often comewith options for security, automated backup anddisaster recovery. Applications& servicesData on the cloud can be stored in databases ordata warehouses as a service and these often comewith options for security, automated backup anddisaster recovery. networkNetworks allow users to connect to their computeinstances, develop web services and utilize cloudservices in a and secure way. \ No newline at end of file diff --git a/content/Azure/images/frustrated_cloud.svg b/content/Azure/images/frustrated_cloud.svg new file mode 100644 index 0000000..3638942 --- /dev/null +++ b/content/Azure/images/frustrated_cloud.svg @@ -0,0 +1 @@ +??? \ No newline at end of file diff --git a/content/Azure/intro_to_Azure_Essentials.ipynb b/content/Azure/intro_to_Azure_Essentials.ipynb index 45acd85..c7ec784 100644 --- a/content/Azure/intro_to_Azure_Essentials.ipynb +++ b/content/Azure/intro_to_Azure_Essentials.ipynb @@ -10,7 +10,7 @@ "The modules in this lesson are: \n", "\n", "1. [Introduction to the Azure Cloud Portal](./01_intro_to_cloud_console)\n", - "2. [Introduction to Cloud Compute (Azure Virtual Machines)](./02_intro_to_compute_part1)\n", + "2. [Introduction to Cloud Compute (Azure Virtual Machines)](./02_intro_to_compute)\n", "3. [Introduction to the Azure CLI](./04_intro_to_cli)\n", "4. [Introduction to Cloud Storage (Blob Storage)](./05_intro_to_cloud_storage)\n", "5. [Running Analysis on the Cloud](./06_running_analysis)\n", @@ -21,7 +21,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.5" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/content/_toc.yml b/content/_toc.yml index 38a8fcb..2fc584c 100644 --- a/content/_toc.yml +++ b/content/_toc.yml @@ -25,8 +25,7 @@ parts: - file: Azure/intro_to_Azure_Essentials sections: - file: Azure/01_intro_to_cloud_console - - file: Azure/02_intro_to_compute_part1 - - file: Azure/03_intro_to_compute_part2 + - file: Azure/02_intro_to_compute - file: Azure/04_intro_to_cli - file: Azure/05_intro_to_cloud_storage - file: Azure/06_running_analysis diff --git a/scripts/azure-create.sh b/scripts/azure-create.sh index 6c3693b..43d8df8 100755 --- a/scripts/azure-create.sh +++ b/scripts/azure-create.sh @@ -15,23 +15,29 @@ REPO="git@${GITHUB}:CLASS/${PROJECT}.git" echo "=== azure-create.sh $PROJECT $BRANCH" SUBSCRIPTION=$(az account show --query id -otsv) -RESOURCE_GROUP=$VM +RESOURCE_GROUP="rg-${VM}-dev" echo "+++ creating resource group $RESOURCE_GROUP $SUBSCRIPTION" az group create --resource-group $RESOURCE_GROUP --location $LOCATION echo "+++ creating VM $VM" # Ubuntu is "Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest" +# Debian is "Debian:debian-10:10:latest" +# Resource Group scope "subscriptions/$SUBSCRIPTION/resourceGroups/$RESOURCE_GROUP" az vm create --resource-group $RESOURCE_GROUP --name $VM \ --image Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest \ - --size Standard_D4_v4 \ + --size Standard_D2_v4 \ --storage-sku Standard_LRS \ --public-ip-sku Standard \ --assign-identity \ --scope "subscriptions/$SUBSCRIPTION/resourceGroups/$RESOURCE_GROUP" \ --admin-username $NAME -IP=$(az vm show --name essentials --resource-group essentials -d --query publicIps -otsv) +IP=$(az vm show --name $VM --resource-group $RESOURCE_GROUP -d --query publicIps -otsv) +IDENTITY=$(az vm show --name $VM --resource-group $RESOURCE_GROUP --query identity.principalId -otsv) + +echo "+++ assign the VM the Contributor role to the subscription ($IDENTITY to $SUBSCRIPTION)" +az role assignment create --assignee $IDENTITY --scope /subscriptions/$SUBSCRIPTION --role Contributor echo "+++ wait for boot and cloud-init ${VM} ${IP}" ssh-keygen -R $IP @@ -40,11 +46,12 @@ while ! ssh $NAME@$IP sudo cloud-init status --wait ; do done echo "+++ configuring VM" -ssh -A $NAME@$VM < .ssh/known_hosts git config --global color.ui auto git config --global push.default simple diff --git a/scripts/azure-delete.sh b/scripts/azure-delete.sh index 2f2a0c5..569a926 100755 --- a/scripts/azure-delete.sh +++ b/scripts/azure-delete.sh @@ -5,6 +5,11 @@ # Static Config - update *.sh files VM=essentials -RESOURCE_GROUP=$VM +echo "=== azure-delete.sh $PROJECT $BRANCH" +SUBSCRIPTION=$(az account show --query id -otsv) +RESOURCE_GROUP_DEV="rg-${VM}-dev" +RESOURCE_GROUP="rg-${VM}" + az vm delete --resource-group $RESOURCE_GROUP --name $VM --yes -#az group delete --resource-group $RESOURCE_GROUP --yes +az group delete --resource-group $RESOURCE_GROUP --yes +az group delete --resource-group $RESOURCE_GROUP_DEV --yes