diff --git a/content/Azure/01_intro_to_cloud_console.ipynb b/content/Azure/01_intro_to_cloud_console.ipynb index 8cfb88d..4fb7891 100644 --- a/content/Azure/01_intro_to_cloud_console.ipynb +++ b/content/Azure/01_intro_to_cloud_console.ipynb @@ -162,12 +162,17 @@ }, { "cell_type": "markdown", - "id": "ebc30bae", + "id": "53c387b4", "metadata": {}, "source": [ - "## Open a Cloud Shell\n", + "## Open the 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 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", + "To use the Azure Cloud Shell:\n", + " \n", + " * Open up a Cloud Shell by clicking on the cloud shell icon (greater than sign followed by underscore) on the blue bar just to the right of search window. On first launch, Cloud Shell prompts to create a resource group, storage account, and Azure Files share on your behalf. This will open a cloud shell at the bottum of your browser window. You can choose a bash shell or Power shell.\n", + " * If you want a new cloud shell in a different window, click the new cloud shell button (file icon with + in upper right corner) on the cloud shell menu bar. This will create a new cloud shell window tab. **Note:** you may need to allow popups or enable popups for this website depending on the browser you use. You can also pull up the tab to increase the shell screen size.\n", + " * To quit cloud shell type exit at the prompt.\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", @@ -251,7 +256,7 @@ }, { "cell_type": "markdown", - "id": "8bb7ae75", + "id": "4e58abb6", "metadata": {}, "source": [ "## Overview of what we will create\n", @@ -260,7 +265,7 @@ "going to do. First we will create a Virtual Machine (VM) and in doing so create a Resource Group. Then we will \n", "create a Storage Account and in that a blob storage container. After that we will create a blob and upload it to\n", "the blob contaioner.\n", - "![Azure-essentails-outline](images/azure-essentails-outline.png)" + "![Azure-essentails-outline](images/azure-essentials-outline.png)" ] }, { diff --git a/content/Azure/02_intro_to_compute.ipynb b/content/Azure/02_intro_to_compute.ipynb index b95664b..76ae621 100644 --- a/content/Azure/02_intro_to_compute.ipynb +++ b/content/Azure/02_intro_to_compute.ipynb @@ -47,11 +47,14 @@ }, { "cell_type": "markdown", - "id": "a4dd13ae", + "id": "4e830d60", "metadata": {}, "source": [ - "Before we begin this lesson, we need to create a *ssh key pair* so that we can securely login to the Virtual Machone \n", - "(VM) we are about to create. We will need a ssh public key when we create the VM.\n", + "Before we begin this lesson, we need to create a *ssh key pair* so \n", + "that we can securely login to the Virtual Machone (VM) we are about \n", + "to create. We will need a ssh public key when we create the VM. If \n", + "you have already created a key pair in the previous lession: [Intro to Cloud Console](01_intro_to_cloud_console.ipynb)\n", + "then continue to step 2.\n", "\n", "**Step 1.**\n", "\n", @@ -202,7 +205,7 @@ }, { "cell_type": "markdown", - "id": "65d977eb", + "id": "5f12143a", "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", @@ -213,14 +216,12 @@ "* 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" + " * Leave as default" ] }, { "cell_type": "markdown", - "id": "4feb08e9", + "id": "1dde7b24", "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", @@ -236,9 +237,7 @@ "* Select inbound port(s)\n", " * Use 22 for ssh access\n", "* Delete public IP and NIC when VM is deleted\n", - " * Check this box\n", - "\n", - "![vm-networking](images/03_CLASS_Azure_VM_networking.png)" + " * Check this box" ] }, { @@ -280,15 +279,6 @@ "RG, status, subscriptioin as well as other properties and information. Find and record the Public IP address. " ] }, - { - "cell_type": "markdown", - "id": "62c6abd4", - "metadata": {}, - "source": [ - "## Security\n", - "## Enumerate the VM Instances" - ] - }, { "cell_type": "markdown", "id": "dd25a15a", @@ -311,6 +301,31 @@ "ssh @" ] }, + { + "cell_type": "markdown", + "id": "b05f3fd8", + "metadata": {}, + "source": [ + "If this is your first time logging in, you will be prompted with The \n", + "authenticity of host 'IP' can't be established. Type 'yes' and this \n", + "will add the host to the ~/.ssh/*know_hosts file. After doing this \n", + "once you will not be prompted again (unless the host key changes or \n", + "the host is removed from the ~/.ssh/know_hosts file." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ca04cfba", + "metadata": {}, + "outputs": [], + "source": [ + "ssh azureuser@52.168.77.0\n", + "The authenticity of host '52.168.77.0 (52.168.77.0)' can't be established.\n", + "ECDSA key fingerprint is SHA256:F/3poSNTVVNbfSp3Kc7zBGwiGzt3qwrmjiyfI1ZHnX4.\n", + "Are you sure you want to continue connecting (yes/no)?" + ] + }, { "cell_type": "markdown", "id": "41119145", @@ -340,10 +355,10 @@ }, { "cell_type": "markdown", - "id": "937e31d4", + "id": "f0b6bea0", "metadata": {}, "source": [ - "## Refernce" + "## Reference" ] } ], diff --git a/content/Azure/03_intro_to_cloud_storage.ipynb b/content/Azure/03_intro_to_cloud_storage.ipynb index 8bfd866..e8cf76e 100644 --- a/content/Azure/03_intro_to_cloud_storage.ipynb +++ b/content/Azure/03_intro_to_cloud_storage.ipynb @@ -31,10 +31,13 @@ }, { "cell_type": "markdown", - "id": "b8a6b10f", + "id": "a07c2033", "metadata": {}, "source": [ - "One of the most common and economic ways to store data in the cloud is to use object storage. In Azure object storage is called *blob storage*, which is similar to the Simple Storage Service, also known as S3, on Amazon Web Services (AWS). For object storage, information is stored as a collection of key-value pairs." + "One of the most common and economic ways to store data in the cloud \n", + "is to use object storage. In Azure object storage is called *blob \n", + "storage*, which is similar to the Simple Storage Service, also known \n", + "as S3, on Amazon Web Services (AWS)." ] }, { @@ -55,58 +58,29 @@ }, { "cell_type": "markdown", - "id": "63d54ced", - "metadata": { - "tags": [] - }, - "source": [ - "## Security (Still need to update for Azure)" - ] - }, - { - "cell_type": "markdown", - "id": "06c38751", - "metadata": {}, - "source": [ - "## Create Resource Group (Note sure if this is needed)\n", - "\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", - " * Use the Resource Group we create earlier during the VM creation process\n", - "* Leave the rest as default\n", - "* Click Review & Create\n", - "* After passing validation, click create\n" - ] - }, - { - "cell_type": "markdown", - "id": "00376ac9", + "id": "b4557f55", "metadata": {}, "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", + "Like all things in Azure you will need an account to manage your \n", + "service. In this case we need a storage account. To create a \n", + "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", + " * The name must be all lower case and unique\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" + "* The page will indicate when the account has been deployed. Click \n", + "on \"go to resource\"" ] }, { diff --git a/content/Azure/04_intro_to_cli.ipynb b/content/Azure/04_intro_to_cli.ipynb index f6efbaa..6bbc2b3 100644 --- a/content/Azure/04_intro_to_cli.ipynb +++ b/content/Azure/04_intro_to_cli.ipynb @@ -24,21 +24,22 @@ }, { "cell_type": "markdown", - "id": "7ec8b5bf", + "id": "972274c3", "metadata": {}, "source": [ "## Cloud Automation\n", "\n", - "Now that Drew can create a bucket in the web console they wish to learn how to use tools to automate the process. Drew noticed that the web console could be used to upload and share objects but wishes to learn the command line so that they can automate the and document the process (it is much easier to document commands then describing and showing mouse clicks).\n", - "\n", - "The cloud can 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", - "Just as with navigating the web console it is important to know the **who**, **what**, and **where** of CLI access to reduce the possibility of access mistakes. We will first verify the tools are installed and configured correctly. Next we get the Account being used (who) and the Subscription ID (where). We will then use the CLI to list some public Buckets (what)." + "Now that Drew can create a bucket in the web console they want to \n", + "learn how to use tools to automate the process. Drew noticed that the\n", + "web console could be used to upload and share objects but wishes to \n", + "learn the command line so that they can automate and document the \n", + "process (it is much easier to document commands then describing and \n", + "showing mouse clicks)." ] }, { "cell_type": "markdown", - "id": "68bd896e", + "id": "1084b066", "metadata": {}, "source": [ "## Open the Cloud Shell\n", @@ -89,10 +90,75 @@ }, { "cell_type": "markdown", - "id": "c61af998", + "id": "68cd5ea6", + "metadata": {}, + "source": [ + "## Update packages of the VM\n", + "\n", + "First make sure that the VM is up to date with the latest versions of \n", + "pachages and security patches by running the following commands." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c8cf5a71", + "metadata": {}, + "outputs": [], + "source": [ + "sudo apt-get update -y && sudo apt-get upgrade -y" + ] + }, + { + "cell_type": "markdown", + "id": "11e22dae", + "metadata": {}, + "source": [ + "Install the azure CLI by executing the the curl command below. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "203fbdc6", + "metadata": {}, + "outputs": [], + "source": [ + "curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash" + ] + }, + { + "cell_type": "markdown", + "id": "68a1825e", + "metadata": {}, + "source": [ + "login into azure" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a493451", + "metadata": {}, + "outputs": [], + "source": [ + "az login" + ] + }, + { + "cell_type": "markdown", + "id": "a35741c0", "metadata": {}, "source": [ - "# az account list" + "You will be prompted got to https://microsoft.com/devicelogin and enter the \n", + "code (string of letters & numbers) listed. Open another tab in your \n", + "browser, go to the URL above and paste in the code. Follow the steps \n", + "to verify login.\n", + "\n", + " * Verify your account\n", + " * Press Continue - Are you trying to sign in to CLI?.\n", + " * Close the tab\n", + "\n" ] }, { @@ -108,17 +174,21 @@ ] }, { - "cell_type": "markdown", - "id": "a67e26c4", + "cell_type": "code", + "execution_count": null, + "id": "f7d14f9c", "metadata": {}, + "outputs": [], "source": [ "TEST=1" ] }, { - "cell_type": "markdown", - "id": "2af53bf6", + "cell_type": "code", + "execution_count": null, + "id": "02e59531", "metadata": {}, + "outputs": [], "source": [ "echo $TEST" ] @@ -149,14 +219,6 @@ "echo \"${HOSTNAME}\"" ] }, - { - "cell_type": "markdown", - "id": "0722637d", - "metadata": {}, - "source": [ - "If you are using the cloudshell then your hostname will look similar to cc-2510c465-7677c9dc4c-fcl8k" - ] - }, { "cell_type": "markdown", "id": "e07f6919", @@ -172,7 +234,7 @@ "metadata": {}, "outputs": [], "source": [ - "# date" + "date" ] }, { @@ -182,66 +244,54 @@ "metadata": {}, "outputs": [], "source": [ - "# echo \"Date: $(date)\"" + "echo \"Date: $(date)\"" ] }, { "cell_type": "markdown", - "id": "108b3e76", - "metadata": { - "tags": [] - }, + "id": "cbf75abc", + "metadata": {}, "source": [ - "First, as with all Azure work we need to create a Resource Group (RG). A resource group is a logical container into which Azure resources are deployed and managed. Now let us combine all of the above to create a RG but first let us set a RG name and region env variable so we do not need to use the actual value in future commands.\n", - "\n", - "Example:" + "Define some environment variables from the resources created in \n", + "previous lessons." ] }, { "cell_type": "markdown", - "id": "1c87694c", - "metadata": {}, + "id": "2671dc02", + "metadata": { + "tags": [] + }, "source": [ - "Define some enviroment variables." + "First, as with all Azure work we need to create a Resource Group (RG).\n", + "A resource group is a logical container into which Azure resources \n", + "are deployed and managed." ] }, { "cell_type": "code", - "execution_count": 1, - "id": "d00a37e4", + "execution_count": null, + "id": "6ac8b3d2", "metadata": {}, "outputs": [], "source": [ - "RG=\"rg-essentials\"\n", - "REGION=\"eastus\"" + "SUB\"\"\"\n", + "RG=\"\"\n", + "LOCATION=\"eastus\"\n", + "STGE_ACCT=\"\"\n", + "BLOB_CONT=\"\"" ] }, { "cell_type": "code", - "execution_count": 2, - "id": "2cf44876-a1c7-41cc-9653-cebdcdb3978e", + "execution_count": null, + "id": "83eaa779", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "rg-essentials\n" - ] - } - ], + "outputs": [], "source": [ "echo $RG" ] }, - { - "cell_type": "markdown", - "id": "b11e6783", - "metadata": {}, - "source": [ - "# az group create --name $RG --location $REGION" - ] - }, { "cell_type": "markdown", "id": "a22ac088", @@ -251,16 +301,18 @@ ] }, { - "cell_type": "markdown", - "id": "1a7686fc", + "cell_type": "code", + "execution_count": null, + "id": "93b3c859", "metadata": {}, + "outputs": [], "source": [ - "# az group show --resource-group $RG" + "az group show --resource-group $RG" ] }, { "cell_type": "markdown", - "id": "0eb11c11", + "id": "1caf5c68", "metadata": {}, "source": [ "## Exercise\n", @@ -282,13 +334,15 @@ ] }, { - "cell_type": "markdown", - "id": "8e241cd0", + "cell_type": "code", + "execution_count": null, + "id": "2ade8b4c", "metadata": { "tags": [] }, + "outputs": [], "source": [ - "# az group list --output json | jq" + "az group list --output json" ] } ], diff --git a/content/Azure/05_intro_to_cloud_storage_cli.ipynb b/content/Azure/05_intro_to_cloud_storage_cli.ipynb index 3c4638f..47db61c 100644 --- a/content/Azure/05_intro_to_cloud_storage_cli.ipynb +++ b/content/Azure/05_intro_to_cloud_storage_cli.ipynb @@ -31,71 +31,18 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Open the cloud shell (See: intro_to_cli)\n", - "\n", - "Delpoy blob storage in Azure" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Define some environment variables" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "RG=\"demo_rg\"\n", - "LOCATION=\"eastus\"\n", - "STGE_ACCT=\"demostorac\"\n", - "BLOB_CONT=\"demo-blob-cont\"" + "Now that Drew understands how to create buckets using the web \n", + "console and to use the Azure command line tools. Now Drew is going \n", + "learn to manage blobs using the command line." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Create resource group" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "az group create --name $RG --location $LOCATION" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create storage account\n", - "\n", - "All storage resources need to belong to a storage account." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "az storage account create --name $STGE_ACCT --resource-group $RG --location $LOCATION --sku Standard_ZRS --encryption-services blob" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Create storage container\n", - "\n", - "The following example uses your Azure AD account to authorize the operation to create the container. Before you create the container, assign the Storage Blob Data Contributor role to yourself. Even if you are the account owner, you need explicit permissions to perform data operations against the storage account." + "The first thing Drew needs to do before manipulating blobs is give \n", + "himself the *role* *\"Storage Blob Data Contributor\"* in oder to\n", + "interact with blobs." ] }, { @@ -107,14 +54,7 @@ "az ad signed-in-user show --query objectId -o tsv | az role assignment create \\\n", " --role \"Storage Blob Data Contributor\" \\\n", " --assignee @- \\\n", - " --scope \"/subscriptions//resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STGE_ACCT\"" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now create the storage Container " + " --scope \"/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/\"" ] }, { @@ -123,20 +63,17 @@ "metadata": {}, "outputs": [], "source": [ - "az storage container create --account-name $STGE_ACCT --name $BLOB_CONT --auth-mode login" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now we will upload a file from your local machine" + "az ad signed-in-user show --query objectId -o tsv | az role assignment create --role \"Storage Blob Data Contributor\" --assignee @- --scope \"/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STGE_ACCT\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "## Create a blob and upload to blob storage\n", + "\n", + "Now we will upload a file from your local machine.\n", + "\n", "Create a file to upload" ] }, @@ -153,7 +90,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Copy demo_file to your blob." + "Copy demo_file.txt to your blob." ] }, { @@ -169,7 +106,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Verify that the blob is there by Listing the blobs in the container. " + "Verify that the blob is there by listing the blobs in the container. " ] }, { @@ -194,7 +131,7 @@ "metadata": {}, "outputs": [], "source": [ - "az storage blob download --account-name $STGE_ACCT --container-name $BLOB_CONT --name demo_file_download.txt --file demo_file_upload.txt --auth-mode login" + "az storage blob download --account-name $STGE_ACCT --container-name $BLOB_CONT --name demo_file_upload.txt --file demo_file_download.txt --auth-mode login" ] }, { @@ -217,32 +154,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Verify that the downloaded file is the same file we uploaded." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "diff demo_file.txt demo_file_download.txt" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Clean up" + "## Clean up" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "We will clean up the resources in this lesson in the reverse order that we created them. \n", + "Clean up the resources in this lesson in the reverse order \n", + "that we created them. \n", "\n", - "## Blob\n", "Delete a blob" ] }, @@ -252,30 +173,14 @@ "metadata": {}, "outputs": [], "source": [ - "az storage blob delete --account-name $STGE_ACCT --container-name $BLOB_CONT --name demo_file --auth-mode login" + "az storage blob delete --account-name $STGE_ACCT --container-name $BLOB_CONT --name demo_file_upload.txt --auth-mode login" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Verify the blob was deleted" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "az storage blob list --account-name $STGE_ACCT --container-name $BLOB_CONT --output table --auth-mode login" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Storage Account\n", + "### Clean up Storage Account\n", "Delete the Storage Account." ] }, @@ -285,7 +190,7 @@ "metadata": {}, "outputs": [], "source": [ - "az storage account delete -n $STGE_ACCT -g RG" + "az storage account delete -n $STGE_ACCT -g $RG" ] }, { @@ -303,25 +208,6 @@ "source": [ "az storage account list | grep $STGE_ACCT" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Source Group\n", - "By deleting the Resource Group, you will delete all resouce in that group.\n", - "\n", - "The --no-wait parameter keeps the CLI from blocking while the deletion takes place." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "az group delete --name $RG --no-wait" - ] } ], "metadata": { diff --git a/content/Azure/06_running_analysis.ipynb b/content/Azure/06_running_analysis.ipynb index 402ddc3..e0e6434 100644 --- a/content/Azure/06_running_analysis.ipynb +++ b/content/Azure/06_running_analysis.ipynb @@ -75,49 +75,6 @@ "````" ] }, - { - "cell_type": "markdown", - "id": "95e80449", - "metadata": {}, - "source": [ - "If this is your first time logging in, you will be prompted with *The authenticity of host 'IP' can't be established.\n", - "type 'y' and this will add the host to the ~/.ssh/*know_hosts* file. After doing this once you will not be prompted\n", - "again (unless the host key changes or the host is removed from the ~/.ssh/*know_hosts* file." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "31813a2d", - "metadata": {}, - "outputs": [], - "source": [ - "ssh azureuser@52.168.77.0\n", - "The authenticity of host '52.168.77.0 (52.168.77.0)' can't be established.\n", - "ECDSA key fingerprint is SHA256:F/3poSNTVVNbfSp3Kc7zBGwiGzt3qwrmjiyfI1ZHnX4.\n", - "Are you sure you want to continue connecting (yes/no)?" - ] - }, - { - "cell_type": "markdown", - "id": "9e42ad8c", - "metadata": {}, - "source": [ - "## Secure the VM\n", - "\n", - "First make sure that the VM is up to date with the latest versions of pachages and security patches by running the following commands." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6ca308e5", - "metadata": {}, - "outputs": [], - "source": [ - "sudo apt-get update -y && sudo apt-get upgrade -y" - ] - }, { "cell_type": "markdown", "id": "43c7d723", @@ -187,18 +144,18 @@ }, { "cell_type": "markdown", - "id": "6bb70256", + "id": "6f29b53d", "metadata": {}, "source": [ - "Verify that *landsat-hls-azure.py* & *landsat-env* are listed." + "Verify that *landsat-hls-azure.py* & *setup.sh* are listed." ] }, { "cell_type": "markdown", - "id": "0aa4805f", + "id": "bd671a7b", "metadata": {}, "source": [ - "Run the *landsat-env* file to setup the environment by installing the \n", + "Run the *setup.sh* file to setup the environment by installing the \n", "packages needed for the data analysis workflow." ] }, @@ -209,7 +166,7 @@ "metadata": {}, "outputs": [], "source": [ - "./landsat-env" + "./setup.sh" ] }, { @@ -270,86 +227,6 @@ "test.png" ] }, - { - "cell_type": "markdown", - "id": "89e85f82", - "metadata": {}, - "source": [ - "Define some environment variables from the resources created in previous lessons." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6fc41936", - "metadata": {}, - "outputs": [], - "source": [ - "SUB\"\"\"\n", - "RG=\"\"\n", - "LOCATION=\"eastus\"\n", - "STGE_ACCT=\"\"\n", - "BLOB_CONT=\"\"" - ] - }, - { - "cell_type": "markdown", - "id": "11e22dae", - "metadata": {}, - "source": [ - "Install the azure CLI by executing the the curl command below. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "dca9b76f", - "metadata": {}, - "outputs": [], - "source": [ - "curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "30ffa151", - "metadata": {}, - "outputs": [], - "source": [ - "login into azure" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cdcbd1e2", - "metadata": {}, - "outputs": [], - "source": [ - "az login\n", - "az ad signed-in-user show --query objectId -o tsv | az role assignment create --role \"Storage Blob Data Contributor\" --assignee @- --scope \"/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STGE_ACCT\"" - ] - }, - { - "cell_type": "markdown", - "id": "58a0e9ba", - "metadata": {}, - "source": [ - "Now we need to asign ourselves the role of Storage Blob Data Contributor so we can interact with the \n", - "blob container." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8a639fcc", - "metadata": {}, - "outputs": [], - "source": [ - "az ad signed-in-user show --query objectId -o tsv | az role assignment create --role \"Storage Blob Data Contributor\" --assignee @- --scope \"/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Storage/storageAccounts/$STGE_ACCT\"" - ] - }, { "cell_type": "markdown", "id": "f3640eaa", @@ -401,10 +278,10 @@ }, { "cell_type": "markdown", - "id": "467ad988", + "id": "f953a9ad", "metadata": {}, "source": [ - "Now delete the blob (image,png file)" + "Now delete the blob (image.png file)" ] }, { diff --git a/content/Azure/07_monitoring_costs.ipynb b/content/Azure/07_monitoring_costs.ipynb index b5c7c53..aa655db 100644 --- a/content/Azure/07_monitoring_costs.ipynb +++ b/content/Azure/07_monitoring_costs.ipynb @@ -57,14 +57,6 @@ "* Note: These values may all be zero if there are no resources allocated yet in this account. Also, in this example there\n", "is only one resource listed.\n" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ae56bbd1", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/content/Azure/08_cleaning_up_resources.ipynb b/content/Azure/08_cleaning_up_resources.ipynb index 0494252..e10726d 100644 --- a/content/Azure/08_cleaning_up_resources.ipynb +++ b/content/Azure/08_cleaning_up_resources.ipynb @@ -24,23 +24,12 @@ }, { "cell_type": "markdown", - "id": "1377081d-7da5-4088-8ba9-966f297af1d6", + "id": "b5509da0", "metadata": {}, "source": [ "## Remove Resource Group\n", "\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": "markdown", - "id": "7171ff08", - "metadata": {}, - "source": [ - "RG=rg-essentials\n", - "echo $RG" + "Removing a resource group removes all the resources associated with the resource group." ] }, { @@ -52,27 +41,31 @@ ] }, { - "cell_type": "markdown", - "id": "b5d3261e", + "cell_type": "code", + "execution_count": null, + "id": "2b14f17c", "metadata": {}, + "outputs": [], "source": [ "az vm list --resource-group $RG --output table" ] }, { "cell_type": "markdown", - "id": "8ada5056-3963-4ca0-9250-ac0e6dc8aba8", + "id": "96e26725", "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!**" + "**WARNING: This will remove all resources (virtual machines, storage buckets, etc.) from your resource group!**" ] }, { - "cell_type": "markdown", - "id": "92c8ae09", + "cell_type": "code", + "execution_count": null, + "id": "911937bf", "metadata": {}, + "outputs": [], "source": [ "az group delete --resource-group $RG --yes" ] @@ -80,7 +73,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -94,7 +87,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.9.7" } }, "nbformat": 4, diff --git a/content/Azure/images/azure-essentials-outline.png b/content/Azure/images/azure-essentials-outline.png new file mode 100644 index 0000000..6078837 Binary files /dev/null and b/content/Azure/images/azure-essentials-outline.png differ