From 77c7abe6b8a877a179c47c18bf5ad0dc81485fdc Mon Sep 17 00:00:00 2001 From: jmenne Date: Wed, 3 Feb 2021 15:52:06 +0100 Subject: [PATCH] no fenced code language no fenced code language --- .../Labs/LAB_09a-Implement_Web_Apps.md | 72 +++++++++---------- ..._09c-Implement_Azure_Kubernetes_Service.md | 42 +++++------ .../Labs/LAB_11-Implement_Monitoring.md | 4 +- 3 files changed, 57 insertions(+), 61 deletions(-) diff --git a/Instructions/Labs/LAB_09a-Implement_Web_Apps.md b/Instructions/Labs/LAB_09a-Implement_Web_Apps.md index 754640de..760a4a8f 100644 --- a/Instructions/Labs/LAB_09a-Implement_Web_Apps.md +++ b/Instructions/Labs/LAB_09a-Implement_Web_Apps.md @@ -14,14 +14,14 @@ You need to evaluate the use of Azure Web apps for hosting Contoso's web sites, ## Objectives In this lab, you will: - + + Task 1: Create an Azure web app + Task 2: Create a staging deployment slot + Task 3: Configure web app deployment settings + Task 4: Deploy code to the staging deployment slot + Task 5: Swap the staging slots + Task 6: Configure and test autoscaling of the Azure web app - + ## Estimated timing: 30 minutes ## Instructions @@ -30,7 +30,7 @@ In this lab, you will: #### Task 1: Create an Azure web app -In this task, you will create an Azure web app. +In this task, you will create an Azure web app. 1. Sign in to the [**Azure portal**](http://portal.azure.com). @@ -48,40 +48,39 @@ In this task, you will create an Azure web app. | Operating system | **Windows** | | Region | the name of an Azure region where you can provision Azure web apps | | App service plan | accept the default configuration | - -1. Click **Review + create**, and then click **Create**. +1. Click **Review + create**, and then click **Create**. - >**Note**: Wait until the web app is created before you proceed to the next task. This should take about a minute. + >**Note**: Wait until the web app is created before you proceed to the next task. This should take about a minute. 1. On the deployment blade, click **Go to resource**. #### Task 2: Create a staging deployment slot -In this task, you will create a staging deployment slot. +In this task, you will create a staging deployment slot. 1. On the blade of the newly deployed web app, click the **URL** link to display the default web page in a new browser tab. -1. Close the new browser tab and, back in the Azure portal, in the **Deployment** section of the web app blade, click **Deployment slots**. +1. Close the new browser tab and, back in the Azure portal, in the **Deployment** section of the web app blade, click **Deployment slots**. - >**Note**: The web app, at this point, has a single deployment slot labeled **PRODUCTION**. + >**Note**: The web app, at this point, has a single deployment slot labeled **PRODUCTION**. -1. Click **+ Add slot**, and add a new slot with the following settings: +1. Click **+ Add slot**, and add a new slot with the following settings: | Setting | Value | | --- | ---| | Name | **staging** | | Clone settings from | **Do not clone settings**| -1. Back on the **Deployment slots** blade of the web app, click the entry representing the newly created staging slot. +1. Back on the **Deployment slots** blade of the web app, click the entry representing the newly created staging slot. - >**Note**: This will open the blade displaying the properties of the staging slot. + >**Note**: This will open the blade displaying the properties of the staging slot. 1. Review the staging slot blade and note that its URL differs from the one assigned to the production slot. #### Task 3: Configure web app deployment settings -In this task, you will configure web app deployment settings. +In this task, you will configure web app deployment settings. 1. On the staging deployment slot blade, in the **Deployment** section, click **Deployment Center**. @@ -89,23 +88,23 @@ In this task, you will configure web app deployment settings. 1. In the **Continuous Deployment (CI/CD)** section, select **Local Git**, and then click **Continue**. -1. Select **App Service build service**, click **Continue**, and then click **Finish**. +1. Select **App Service build service**, click **Continue**, and then click **Finish**. 1. Copy the resulting **Git Clone Url** to Notepad. >**Note:** You will need the Git Clone Url value in the next task of this lab. -1. Click **Deployment Credentials** toolbar icon to display **Deployment Credentials** pane. +1. Click **Deployment Credentials** toolbar icon to display **Deployment Credentials** pane. 1. Click **User credentials**. -1. Complete the required information, and then click **Save Credentials**. +1. Complete the required information, and then click **Save Credentials**. | Setting | Value | | --- | ---| | User name | any unique name (must not contain `@` character) | | Password | any password that satisfies complexity requirements | - + >**Note:** The password must be at least eight characters long, with two of the following three elements: letters, numbers, and non-alphanumeric characters. >**Note:** You will need these credentials in the next task of this lab. @@ -116,32 +115,33 @@ In this task, you will deploy code to the staging deployment slot. 1. In the Azure portal, open the **Azure Cloud Shell** by clicking on the icon in the top right of the Azure Portal. -1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. +1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. - >**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and click **Create storage**. + >**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and click **Create storage**. 1. From the Cloud Shell pane, run the following to clone the remote repository containing the code for the web app. ```powershell git clone https://github.com/Azure-Samples/php-docs-hello-world ``` - + 1. From the Cloud Shell pane, run the following to set the current location to the newly created clone of the local repository containing the sample web app code. - ``` + ```powershell Set-Location -Path $HOME/php-docs-hello-world/ ``` 1. From the Cloud Shell pane, run the following to add the remote git (make sure to replace the `[deployment_user_name]` and `[git_clone_url]` placeholders with the value of the **Deployment Credentials** user name and **Git Clone Url**, respectively, which you identified in previous task): - ``` + ```powershell git remote add [deployment_user_name] [git_clone_url] ``` >**Note**: The value following `git remote add` does not have to match the **Deployment Credentials** user name, but has to be unique 1. From the Cloud Shell pane, run the following to push the sample web app code from the local repository to the Azure web app staging deployment slot (make sure to replace the `[deployment_user_name]` placeholder with the value of the **Deployment Credentials** user name, which you identified in previous task): - ``` + + ```powershell git push [deployment_user_name] master ``` @@ -161,19 +161,19 @@ In this task, you will swap the staging slot with the production slot 1. In the **Deployment** section, click **Deployment slots** and then, click **Swap** toolbar icon. -1. On the **Swap** blade, review the default settings and click **Swap**. +1. On the **Swap** blade, review the default settings and click **Swap**. 1. Click **Overview** on the production slot blade of the web app and then click the **URL** link to display the web site home page in a new browser tab. -1. Verify the default web page has been replaced with the **Hello World!** page. +1. Verify the default web page has been replaced with the **Hello World!** page. #### Task 6: Configure and test autoscaling of the Azure web app - -In this task, you will configure and test autoscaling of Azure web app. + +In this task, you will configure and test autoscaling of Azure web app. 1. On the blade displaying the production slot of the web app, in the **Settings** section, click **Scale out (App Service plan)**. -1. Click **Custom autoscale**. +1. Click **Custom autoscale**. >**Note**: You also have the option of scaling the web app manually. @@ -209,7 +209,7 @@ In this task, you will configure and test autoscaling of Azure web app. 1. In the Azure portal, open the **Azure Cloud Shell** by clicking on the icon in the top right of the Azure Portal. -1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. +1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. 1. From the Cloud Shell pane, run the following to identify the URL of the Azure web app. @@ -227,7 +227,7 @@ In this task, you will configure and test autoscaling of Azure web app. 1. Minimize the Cloud Shell pane (but do not close it) and, on the web app blade, in the **Monitoring** section, click **Process explorer**. - >**Note**: Process explorer facilitates monitoring the number of instances and their resource utilization. + >**Note**: Process explorer facilitates monitoring the number of instances and their resource utilization. 1. Monitor the utilization and the number of instances for a few minutes. @@ -261,9 +261,9 @@ In this task, you will configure and test autoscaling of Azure web app. In this lab, you have: -- Created an Azure web app -- Created a staging deployment slot -- Configured web app deployment settings -- Deployed code to the staging deployment slot -- Swapped the staging slots -- Configured and test autoscaling of the Azure web app ++ Created an Azure web app ++ Created a staging deployment slot ++ Configured web app deployment settings ++ Deployed code to the staging deployment slot ++ Swapped the staging slots ++ Configured and test autoscaling of the Azure web app diff --git a/Instructions/Labs/LAB_09c-Implement_Azure_Kubernetes_Service.md b/Instructions/Labs/LAB_09c-Implement_Azure_Kubernetes_Service.md index 15b946dd..39aa8bdf 100644 --- a/Instructions/Labs/LAB_09c-Implement_Azure_Kubernetes_Service.md +++ b/Instructions/Labs/LAB_09c-Implement_Azure_Kubernetes_Service.md @@ -33,26 +33,25 @@ In this task, you will register resource providers necessary to deploy an Azure 1. In the Azure portal, open the **Azure Cloud Shell** by clicking on the icon in the top right of the Azure Portal. -1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. +1. If prompted to select either **Bash** or **PowerShell**, select **PowerShell**. - >**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and click **Create storage**. + >**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and click **Create storage**. 1. From the Cloud Shell pane, run the following to register the Microsoft.Kubernetes and Microsoft.KubernetesConfiguration resource providers. ```powershell Register-AzResourceProvider -ProviderNamespace Microsoft.Kubernetes - + Register-AzResourceProvider -ProviderNamespace Microsoft.KubernetesConfiguration ``` -1. Close the Cloud Shell pane. - +1. Close the Cloud Shell pane. #### Task 2: Deploy an Azure Kubernetes Service cluster In this task, you will deploy an Azure Kubernetes Services cluster by using the Azure portal. -1. In the Azure portal, search for locate **Kubernetes services** and then, on the **Kubernetes services** blade, click **+ Add**, and then click **+ Add Kubernetes cluster**. +1. In the Azure portal, search for locate **Kubernetes services** and then, on the **Kubernetes services** blade, click **+ Add**, and then click **+ Add Kubernetes cluster**. 1. On the **Basics** tab of the **Create Kubernetes cluster** blade, specify the following settings (leave others with their default values): @@ -72,7 +71,7 @@ In this task, you will deploy an Azure Kubernetes Services cluster by using the | ---- | ---- | | Virtual nodes | **Disabled** | | VM scale sets | **Enabled** | - + 1. Click **Next: Authentication >** and, on the **Authentication** tab of the **Create Kubernetes cluster** blade, specify the following settings (leave others with their default values): | Setting | Value | @@ -80,7 +79,6 @@ In this task, you will deploy an Azure Kubernetes Services cluster by using the | Service principal | accept the default | | Enable RBAC | **Yes** | - 1. Click **Next: Networking >** and, on the **Networking** tab of the **Create Kubernetes cluster** blade, specify the following settings (leave others with their default values): | Setting | Value | @@ -88,13 +86,12 @@ In this task, you will deploy an Azure Kubernetes Services cluster by using the | Network configuration | **kubenet** | | DNS name prefix | any valid, globally unique DNS host name | -1. Click **Next: Integration >**, on the **Integration** tab of the **Create Kubernetes cluster** blade, set **Container monitoring** to **Disabled**, click **Review + create** and then click **Create**. +1. Click **Next: Integration >**, on the **Integration** tab of the **Create Kubernetes cluster** blade, set **Container monitoring** to **Disabled**, click **Review + create** and then click **Create**. - >**Note**: In production scenarios, you would want to enable monitoring. Monitoring is disabled in this case since it is not covered in the lab. + >**Note**: In production scenarios, you would want to enable monitoring. Monitoring is disabled in this case since it is not covered in the lab. >**Note**: Wait for the deployment to complete. This should take about 10 minutes. - #### Task 3: Deploy pods into the Azure Kubernetes Service cluster In this task, you will deploy a pod into the Azure Kubernetes Service cluster. @@ -117,7 +114,7 @@ In this task, you will deploy a pod into the Azure Kubernetes Service cluster. AKS_CLUSTER='az104-9c-aks1' az aks get-credentials --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER - ``` + ``` 1. From the **Cloud Shell** pane, run the following to verify connectivity to the AKS cluster: @@ -125,7 +122,7 @@ In this task, you will deploy a pod into the Azure Kubernetes Service cluster. kubectl get nodes ``` -1. In the **Cloud Shell** pane, review the output and verify that the one node which the cluster consists of at this point is reporting the **Ready** status. +1. In the **Cloud Shell** pane, review the output and verify that the one node which the cluster consists of at this point is reporting the **Ready** status. 1. From the **Cloud Shell** pane, run the following to deploy the **nginx** image from the Docker Hub: @@ -170,11 +167,11 @@ In this task, you will scale horizontally the number of pods and then number of 1. From the **Cloud Shell** pane, and run the following to scale the deployment by increasing of the number of pods to 2: ```sh - + RESOURCE_GROUP='az104-09c-rg1' AKS_CLUSTER='az104-9c-aks1' - + kubectl scale --replicas=2 deployment/nginx-deployment ``` @@ -204,13 +201,13 @@ In this task, you will scale horizontally the number of pods and then number of 1. From the **Cloud Shell** pane, run the following to scale the deployment: - ``` + ```sh kubectl scale --replicas=10 deployment/nginx-deployment ``` 1. From the **Cloud Shell** pane, run the following to verify the outcome of scaling the deployment: - ``` + ```sh kubectl get pods ``` @@ -218,7 +215,7 @@ In this task, you will scale horizontally the number of pods and then number of 1. From the **Cloud Shell** pane, run the following to review the pods distribution across cluster nodes: - ``` + ```sh kubectl get pod -o=custom-columns=NODE:.spec.nodeName,POD:.metadata.name ``` @@ -226,13 +223,12 @@ In this task, you will scale horizontally the number of pods and then number of 1. From the **Cloud Shell** pane, run the following to delete the deployment: - ``` + ```sh kubectl delete deployment nginx-deployment ``` 1. Close the **Cloud Shell** pane. - #### Clean up resources >**Note**: Remember to remove any newly created Azure resources that you no longer use. Removing unused resources ensures you will not see unexpected charges. @@ -257,6 +253,6 @@ In this task, you will scale horizontally the number of pods and then number of In this lab, you have: -- Deployed an Azure Kubernetes Service cluster -- Deployed pods into the Azure Kubernetes Service cluster -- Scaled containerized workloads in the Azure Kubernetes service cluster ++ Deployed an Azure Kubernetes Service cluster ++ Deployed pods into the Azure Kubernetes Service cluster ++ Scaled containerized workloads in the Azure Kubernetes service cluster diff --git a/Instructions/Labs/LAB_11-Implement_Monitoring.md b/Instructions/Labs/LAB_11-Implement_Monitoring.md index bfe0504f..c520d8e9 100644 --- a/Instructions/Labs/LAB_11-Implement_Monitoring.md +++ b/Instructions/Labs/LAB_11-Implement_Monitoring.md @@ -256,7 +256,7 @@ In this task, you will configure Azure virtual machine diagnostic settings. 1. From the Command Prompt, run the following to trigger increased CPU utilization on the **az104-11-vm0** Azure VM: - ``` + ```sh for /l %a in (0,0,1) do echo a ``` @@ -282,7 +282,7 @@ In this task, you will configure Azure virtual machine diagnostic settings. 1. In the query window, paste the following query, click **Run**, and review the resulting chart: - ``` + ```sh // Virtual Machine available memory // Chart the VM's available memory over the last hour. InsightsMetrics