{"id":3380,"date":"2022-06-11T15:36:56","date_gmt":"2022-06-11T15:36:56","guid":{"rendered":"https:\/\/exceedthecloud.com\/?p=3380"},"modified":"2023-02-02T07:45:06","modified_gmt":"2023-02-02T07:45:06","slug":"deploying-a-multi-container-application-to-azure-kubernetes-services","status":"publish","type":"post","link":"https:\/\/exceedthecloud.com\/?p=3380","title":{"rendered":"Deploying a multi-container application to Azure Kubernetes Services"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/kubernetes-service\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Azure Kubernetes Service (AKS)<\/strong><\/a>&nbsp;is the quickest way to use Kubernetes on Azure.&nbsp;<strong>Azure Kubernetes Service (AKS)<\/strong>&nbsp;manages your hosted Kubernetes environment, making it straightforward to deploy and manage containerized applications without requiring container orchestration expertise. It also enhances agility, scalability, and availability of your containerized workloads. Azure DevOps further streamlines AKS operations by providing continuous build and deployment capabilities.<\/p>\n\n\n\n<p>In this lab, you will use Azure DevOps to deploy a containerized ASP.NET Core web application&nbsp;<strong>MyHealthClinic<\/strong>&nbsp;(MHC) to an AKS cluster.<\/p>\n\n\n\n<p>After you complete this lab, you will be able to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an Azure DevOps team project with a .NET Core application using the Azure DevOps Demo Generator tool.<\/li>\n\n\n\n<li>Use Azure CLI to create an Azure Container registry (ACR), an AKS cluster and an Azure SQL database<\/li>\n\n\n\n<li>Configure containerized application and database deployment by using Azure DevOps<\/li>\n\n\n\n<li>Use Azure DevOps pipelines to build to automatically deploy containerized applications<\/li>\n<\/ul>\n\n\n\n<p>Review applications required for this lab<\/p>\n\n\n\n<p>Identify the applications that you\u2019ll use in this lab:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Microsoft Edge<\/li>\n<\/ul>\n\n\n\n<p>Set up an Azure DevOps organization.<\/p>\n\n\n\n<p>If you don\u2019t already have an Azure DevOps organization that you can use for this lab, create one by following the instructions available at&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/organizations\/accounts\/create-organization?view=azure-devops\" target=\"_blank\" rel=\"noreferrer noopener\">Create an organization or project collection<\/a>.<\/p>\n\n\n\n<p>Prepare an Azure subscription<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Identify an existing Azure subscription or create a new one.<\/li>\n\n\n\n<li>Verify that you have a Microsoft account or an Azure AD account with the Owner role in the Azure subscription and the Global Administrator role in the Azure AD tenant associated with the Azure subscription. For details, refer to&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/role-based-access-control\/role-assignments-list-portal\" target=\"_blank\" rel=\"noreferrer noopener\">List Azure role assignments using the Azure portal<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/roles\/manage-roles-portal#view-my-roles\" target=\"_blank\" rel=\"noreferrer noopener\">View and assign administrator roles in Azure Active Directory<\/a>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Lab 0: Configure the lab prerequisites<\/strong><\/p>\n\n\n\n<p>In this Lab, you will set up the prerequisites for the lab, which consist of a preconfigured team project based on an Azure DevOps Demo Generator template.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 1: Configure the team project<\/strong><\/p>\n\n\n\n<p>In this task, you will use Azure DevOps Demo Generator to generate a new project based on the&nbsp;<strong>Azure Kubernetes Service<\/strong>&nbsp;template.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On your lab computer, start a web browser and navigate to&nbsp;<a href=\"https:\/\/azuredevopsdemogenerator.azurewebsites.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure DevOps Demo Generator<\/a>. This utility site will automate the process of creating a new Azure DevOps project within your account that is prepopulated with content (work items, repos, etc.) required for the lab.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: For more information on the site, see&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/demo-gen\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/demo-gen<\/a>&nbsp;.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"2\">\n<li>Click&nbsp;<strong>Sign in<\/strong>&nbsp;and sign in using the Microsoft account associated with your Azure DevOps subscription.<\/li>\n\n\n\n<li>If required, on the&nbsp;<strong>Azure DevOps Demo Generator<\/strong>&nbsp;page, click&nbsp;<strong>Accept<\/strong>&nbsp;to accept the permission requests for accessing your Azure DevOps subscription.<\/li>\n\n\n\n<li>On the&nbsp;<strong>Create New Project<\/strong>&nbsp;page, in the&nbsp;<strong>New Project Name<\/strong>&nbsp;textbox, type&nbsp;<strong>Deploying a multi-container application to AKS<\/strong>, in the&nbsp;<strong>Select organization<\/strong>&nbsp;dropdown list, select your Azure DevOps organization, and then click&nbsp;<strong>Choose template<\/strong>.<\/li>\n\n\n\n<li>In the list of templates, in the toolbar, click&nbsp;<strong>DevOps Labs<\/strong>, select the&nbsp;<strong>Azure Kubernetes Service<\/strong>&nbsp;template and click&nbsp;<strong>Select Template<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"288\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture1-1.png\" alt=\"\" class=\"wp-image-3381\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture1-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture1-1-300x138.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Back on the&nbsp;<strong>Create New Project<\/strong>&nbsp;page, if prompted to install a missing extension, select the checkbox below the&nbsp;<strong>Replace Tokens<\/strong>&nbsp;and&nbsp;<strong>Kubernetes extension<\/strong>&nbsp;labels and click&nbsp;<strong>Create Project<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: Wait for the process to complete. This should take about 2 minutes. In case the process fails, navigate to your DevOps organization, delete the project, and try again.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"2\">\n<li>On the&nbsp;<strong>Create New Project<\/strong>&nbsp;page, click&nbsp;<strong>Navigate to project<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Lab 1: Deploy a containerized ASP.NET Core web application to an AKS cluster by using Azure DevOps<\/strong><\/p>\n\n\n\n<p>In this Lab, you will deploy a containerized ASP.NET Core web application to an AKS cluster by using Azure DevOps.<\/p>\n\n\n\n<p><strong>Task 1: Deploy Azure resources for the lab<\/strong><\/p>\n\n\n\n<p>In this task, you will use Azure CLI to perform deployment of the Azure resources required for this lab, including:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td>Azure resources<\/td><td>Description<\/td><\/tr><\/thead><tbody><tr><td>Azure Container Registry<\/td><td>Functions as a private store of Docker images<\/td><\/tr><tr><td>AKS<\/td><td>Serves as an orchestrator of containers running Docker images<\/td><\/tr><tr><td>Azure SQL Database<\/td><td>Provides persistent store for containerized workloads running on AKS<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the lab computer, start a web browser, navigate to the&nbsp;<a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Azure Portal<\/strong><\/a>, and sign in with the user account that has at least the Contributor role in the Azure subscription you are using in this lab.<\/li>\n\n\n\n<li>In the Azure portal, in the toolbar, click the&nbsp;<strong>Cloud Shell<\/strong>&nbsp;icon located directly to the right of the search text box.<\/li>\n\n\n\n<li>If prompted to select either&nbsp;<strong>Bash<\/strong>&nbsp;or&nbsp;<strong>PowerShell<\/strong>, select&nbsp;<strong>Bash<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: If this is the first time you are starting&nbsp;<strong>Cloud Shell<\/strong>&nbsp;and you are presented with the&nbsp;<strong>You have no storage mounted<\/strong>&nbsp;message, select the subscription you are using in this lab, and select&nbsp;<strong>Create storage<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"4\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to identify the latest version of Kubernetes available in the Azure region you will be using in this lab (&nbsp;<strong>replace the&nbsp;&lt;Azure_region&gt;&nbsp;placeholder<\/strong>&nbsp;with the name of the Azure region where you intend to deploy resources in this lab):<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LOCATION='eastus'<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: possible locations can be found by running the following command&lt;Azure_region&gt;&nbsp;:&nbsp;az account list-locations -o table, use the value with no spaces in the&nbsp;<strong>Name<\/strong>&nbsp;property.<\/p>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VERSION=$(az aks get-versions --location $LOCATION --query 'orchestrators&#91;-1].orchestratorVersion' --output tsv); echo $VERSION<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to create a resource group that will host the AKS deployment:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RGNAME=exceedm16l01a-RG\naz group create --name $RGNAME --location $LOCATION\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"243\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture2-1.png\" alt=\"\" class=\"wp-image-3382\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture2-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture2-1-300x117.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to create an AKS cluster using the latest version available:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AKSNAME='exceedm16aks'$RANDOM$RANDOM\naz aks create --location $LOCATION --resource-group $RGNAME --name $AKSNAME --enable-addons monitoring --kubernetes-version $VERSION --generate-ssh-keys\n<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: Wait for the deployment complete before you proceed to the next task. AKS deployment might take about 5 minutes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"234\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture3-1.png\" alt=\"\" class=\"wp-image-3383\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture3-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture3-1-300x113.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to create the logical server to host the Azure SQL database you will be using in this lab:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SQLNAME='exceedm16sql'$RANDOM$RANDOM\naz sql server create --location $LOCATION --resource-group $RGNAME --name $SQLNAME --admin-user sqladmin --admin-password P2ssw0rd1234\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"606\" height=\"381\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture4-1.png\" alt=\"\" class=\"wp-image-3384\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture4-1.png 606w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture4-1-300x189.png 300w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture4-1-80x50.png 80w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to allow access from Azure to the newly provisioned logical server:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az sql server firewall-rule create --resource-group $RGNAME --server $SQLNAME --name allowAzure --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"142\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture5-1.png\" alt=\"\" class=\"wp-image-3386\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture5-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture5-1-300x68.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to create the Azure SQL database you will be using in this lab:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az sql db create --resource-group $RGNAME --server $SQLNAME --name mhcdb --service-objective S0 --no-wait<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"75\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture6.png\" alt=\"\" class=\"wp-image-3387\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture6.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture6-300x36.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to create the Azure Container registry you will be using in this lab:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ACRNAME='exceedm16acr'$RANDOM$RANDOM\naz acr create --location $LOCATION --resource-group $RGNAME --name $ACRNAME --sku Standard\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"286\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture7-1.png\" alt=\"\" class=\"wp-image-3388\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture7-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture7-1-300x138.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to grant the AKS-generated managed identity to access to the newly created ACR:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Retrieve the id of the service principal configured for AKS\nCLIENT_ID=$(az aks show --resource-group $RGNAME --name $AKSNAME --query \"identityProfile.kubeletidentity.clientId\" --output tsv)\n\n# Retrieve the ACR registry resource id\nACR_ID=$(az acr show --name $ACRNAME --resource-group $RGNAME --query \"id\" --output tsv)\n\n# Create role assignment\naz role assignment create --assignee $CLIENT_ID --role acrpull --scope $ACR_ID\n<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: For more information regarding this assignment, refer to the&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/container-registry\/container-registry-auth-aks\" target=\"_blank\" rel=\"noreferrer noopener\">Authenticate with Azure Container Registry from Azure Kubernetes Service<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"193\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture8-1.png\" alt=\"\" class=\"wp-image-3389\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture8-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture8-1-300x93.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to display the name of logical server hosting the Azure SQL database you created earlier in this task:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $(az sql server list --resource-group $RGNAME --query '&#91;].name' --output tsv)'.database.windows.net'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"80\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture9-1.png\" alt=\"\" class=\"wp-image-3390\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture9-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture9-1-300x38.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the&nbsp;<strong>Bash<\/strong>&nbsp;session in the Cloud Shell pane, run the following to display the name of the login server of the Azure Container registry you created earlier in this task:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>az acr show --name $ACRNAME --resource-group $RGNAME --query \"loginServer\" --output tsv<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: Record both values. You will need them in the next task.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"95\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture10-1.png\" alt=\"\" class=\"wp-image-3391\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture10-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture10-1-300x46.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Close the Cloud Shell pane.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Task 2: Configure the build and release pipelines<\/strong><\/p>\n\n\n\n<p>In this task, you will configure the build and release pipelines in the Azure DevOps project you generated earlier in this lab, by mapping Azure resources, including the AKS cluster and Azure Container registry to the build and release definitions.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On your lab computer, switch to the web browser window displaying the Azure DevOps portal with the&nbsp;<strong>Deploying a multi-container application to AKS<\/strong>&nbsp;project open, in the vertical menu bar at the far left of the Azure DevOps portal, click&nbsp;<strong>Repos<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: You will first modify the references to the Docker image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"442\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture11-1.png\" alt=\"\" class=\"wp-image-3392\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture11-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture11-1-300x213.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On the&nbsp;<strong>AKS<\/strong>&nbsp;repository pane, in the list of files, select&nbsp;<strong>docker-compose.ci.build.yml<\/strong>.<\/li>\n\n\n\n<li>On the&nbsp;<strong>docker-compose.ci.build.yml<\/strong>&nbsp;pane, click&nbsp;<strong>Edit<\/strong>, replace line&nbsp;<strong>5<\/strong>&nbsp;that references the target Docker image with&nbsp;image: az400mp\/aspnetcore-build:1.0-2.0, select&nbsp;<strong>Commit<\/strong>&nbsp;and, when prompted for confirmation, click&nbsp;<strong>Commit<\/strong>&nbsp;again.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"839\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture12-1.png\" alt=\"\" class=\"wp-image-3393\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture12-1.png 465w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture12-1-166x300.png 166w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On the&nbsp;<strong>AKS<\/strong>&nbsp;repository pane, in the list of files, navigate to the&nbsp;<strong>src\/MyHealth.Web<\/strong>&nbsp;folder and select&nbsp;<strong>Dockerfile<\/strong>.<\/li>\n\n\n\n<li>On the&nbsp;<strong>Dockerfile<\/strong>&nbsp;pane, click&nbsp;<strong>Edit<\/strong>, replace line&nbsp;<strong>1<\/strong>&nbsp;that references the base Docker image with&nbsp;FROM az400mp\/aspnetcore1.0:1.0.4, select&nbsp;<strong>Commit<\/strong>&nbsp;and, when prompted for confirmation, click&nbsp;<strong>Commit<\/strong>&nbsp;again.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"268\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture13-1.png\" alt=\"\" class=\"wp-image-3394\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture13-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture13-1-300x129.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the web browser window displaying the Azure DevOps portal with the&nbsp;<strong>Deploying a multi-container application to AKS<\/strong>&nbsp;project open, in the vertical menu bar at the far left of the Azure DevOps portal, click&nbsp;<strong>Pipelines<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: You will now modify the build pipeline.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"2\">\n<li>On the&nbsp;<strong>Pipelines<\/strong>&nbsp;pane, under&nbsp;<strong>All<\/strong>&nbsp;option, click the entry representing the&nbsp;<strong>MyHealth.AKS.build<\/strong>&nbsp;pipeline and, on the&nbsp;<strong>MyHealth.AKS.build<\/strong>&nbsp;pane, click&nbsp;<strong>Edit<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"321\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture14-1.png\" alt=\"\" class=\"wp-image-3395\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture14-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture14-1-300x154.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>On the&nbsp;<strong>MyHealth.AKS.build<\/strong>&nbsp;pipeline pane, ensure that the&nbsp;<strong>Pipeline<\/strong>&nbsp;entry is selected and, in the&nbsp;<strong>Agent Specifications<\/strong>&nbsp;drop-down list, select&nbsp;<strong>ubuntu-18.04<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"476\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture15-1.png\" alt=\"\" class=\"wp-image-3396\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture15-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture15-1-300x229.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>In the list of tasks of the pipeline, click the&nbsp;<strong>Replace tokens in appsettings.json<\/strong>&nbsp;task, in the&nbsp;<strong>Token pattern<\/strong>&nbsp;dropdown list select&nbsp;__&#8230;__&nbsp;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"511\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture16-1.png\" alt=\"\" class=\"wp-image-3397\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture16-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture16-1-300x246.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the list of tasks of the pipeline, click the&nbsp;<strong>Run services<\/strong>&nbsp;task, on the&nbsp;<strong>Docker Compose<\/strong>&nbsp;pane on the right side, in the&nbsp;<strong>Azure subscription<\/strong>&nbsp;dropdown list, select the entry representing the Azure subscription you are using in this lab, and click&nbsp;<strong>Authorize<\/strong>&nbsp;to create the corresponding service connection. When prompted, sign in using the account with the Owner role in the Azure subscription and the Global Administrator role in the Azure AD tenant associated with the Azure subscription.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: Wait for the authorization process to complete. This step creates an Azure service connection, which defines and secures a connection to the target Azure subscription, using Service Principal Authentication (SPA).<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\" start=\"2\">\n<li>In the list of tasks of the pipeline, with the&nbsp;<strong>Run services<\/strong>&nbsp;task selected, on the&nbsp;<strong>Docker Compose<\/strong>&nbsp;pane on the right side, in the&nbsp;<strong>Azure Container Registry<\/strong>&nbsp;dropdown list, select the entry representing the ACR instance you created earlier in this lab.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>:&nbsp;<strong>Refresh<\/strong>&nbsp;the list if needed and choose previously created ACR.&nbsp;<strong>If no option is shown, type the full ACR name: ACRNAME.azurecr.io<\/strong>).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"515\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture17-1.png\" alt=\"\" class=\"wp-image-3398\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture17-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture17-1-300x248.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Repeat the previous two steps to configure the&nbsp;<strong>Azure subscription<\/strong>&nbsp;(next time do not Authorize again, use the created&nbsp;<strong>Available Azure service connections<\/strong>&nbsp;) and&nbsp;<strong>Azure Container Registry<\/strong>&nbsp;settings in the&nbsp;<strong>Build services<\/strong>,&nbsp;<strong>Push services<\/strong>, and&nbsp;<strong>Lock services<\/strong>&nbsp;tasks, but instead of selecting your Azure subscription in this case, select the newly created service connection.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"500\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture18-1.png\" alt=\"\" class=\"wp-image-3399\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture18-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture18-1-300x240.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><strong>Note<\/strong>: The pipeline consists of the following tasks<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td>Tasks<\/td><td>Usage<\/td><\/tr><\/thead><tbody><tr><td><strong>Replace tokens<\/strong><\/td><td>replace a placeholder with the name of the ACR in the database connection string in the&nbsp;<strong>appsettings.json<\/strong>&nbsp;file and in the&nbsp;<strong>mhc-aks.yaml<\/strong>&nbsp;manifest file<\/td><\/tr><tr><td><strong>Run services<\/strong><\/td><td>prepares the environment by pulling required images, such as aspnetcore-build:1.0-2.0 and restoring packages referenced in&nbsp;<strong>.csproj<\/strong><\/td><\/tr><tr><td><strong>Build services<\/strong><\/td><td>builds the Docker images specified in the&nbsp;<strong>docker-compose.yml<\/strong>&nbsp;file and tags images with the&nbsp;<strong>$(Build.BuildId)<\/strong>&nbsp;and&nbsp;<strong>latest<\/strong>&nbsp;tags<\/td><\/tr><tr><td><strong>Push services<\/strong><\/td><td>pushes the Docker image&nbsp;<strong>myhealth.web<\/strong>&nbsp;to Azure Container Registry<\/td><\/tr><tr><td><strong>Publish Build Artifacts<\/strong><\/td><td>publishes&nbsp;<strong>mhc-aks.yaml<\/strong>&nbsp;&amp;&nbsp;<strong>myhealth.dacpac<\/strong>&nbsp;files to the artifact drop location in Azure DevOps so that they can be used in the subsequent release<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note<\/strong>: The&nbsp;<strong>appsettings.json<\/strong>&nbsp;file contains details of the database connection string used to connect to the Azure SQL database, which you created earlier in this lab. The&nbsp;<strong>mhc-aks.yaml<\/strong>&nbsp;manifest file contains configuration details of&nbsp;<strong>deployments<\/strong>,&nbsp;<strong>services<\/strong>&nbsp;and&nbsp;<strong>pods<\/strong>&nbsp;which will be deployed in Azure Kubernetes Service. For more information regarding deployment manifests, refer to&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/concepts-clusters-workloads#deployments-and-yaml-manifests\" target=\"_blank\" rel=\"noreferrer noopener\">AKS Deployments and YAML manifests<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the list of the&nbsp;<strong>Pipeline variables<\/strong>, update the values of the&nbsp;<strong>ACR<\/strong>&nbsp;and&nbsp;<strong>SQLserver<\/strong>&nbsp;variables with the values you recorded at the end of the previous task (SQLPassword is&nbsp;<strong>P2ssw0rd1234<\/strong>, SQLuser is&nbsp;<strong>sqladmin<\/strong>, SQLdatabase is&nbsp;<strong>mhcdb<\/strong>), then click the down-facing caret next to the&nbsp;<strong>Save &amp; queue<\/strong>&nbsp;button, click&nbsp;<strong>Save<\/strong>&nbsp;to save the changes, and, when prompted again, click&nbsp;<strong>Save<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"371\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture19-1.png\" alt=\"\" class=\"wp-image-3400\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture19-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture19-1-300x178.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the web browser window displaying the Azure DevOps portal, in the vertical menu bar at the far left of the Azure DevOps portal, in the&nbsp;<strong>Pipelines<\/strong>&nbsp;section, click&nbsp;<strong>Releases<\/strong>.<\/li>\n\n\n\n<li>On the&nbsp;<strong>Pipelines \/ Releases<\/strong>&nbsp;pane, select the&nbsp;<strong>MyHealth.AKS.Release<\/strong>&nbsp;entry and click&nbsp;<strong>Edit<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"322\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture20-1.png\" alt=\"\" class=\"wp-image-3401\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture20-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture20-1-300x155.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On the&nbsp;<strong>All pipelines \/ MyHealth.AKS.Release<\/strong>&nbsp;pane, in the rectangle representing the&nbsp;<strong>Dev<\/strong>&nbsp;stage of the deployment, click the&nbsp;<strong>2 jobs, 3 tasks<\/strong>&nbsp;link.<\/li>\n\n\n\n<li>For the&nbsp;<strong>DB deployment<\/strong>&nbsp;job and&nbsp;<strong>AKS deployment<\/strong>&nbsp;job (by clicking on those names) , choose \u201cAgent Pool\u201d&nbsp;<strong>Azure Pipelines \u2013&gt; windows-2019<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"523\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture21-1.png\" alt=\"\" class=\"wp-image-3402\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture21-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture21-1-300x251.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>In the list of tasks of the&nbsp;<strong>Dev<\/strong>&nbsp;stage, within the&nbsp;<strong>DB deployment<\/strong>&nbsp;job section, select the&nbsp;<strong>Execute Azure SQL: DacpacTask<\/strong>&nbsp;task and, on the&nbsp;<strong>Azure SQL Database deployment<\/strong>&nbsp;pane on the right side, in the&nbsp;<strong>Azure Subscription<\/strong>&nbsp;dropdown list, select the entry representing the Azure service connection you created earlier in this task.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"522\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture22-1.png\" alt=\"\" class=\"wp-image-3403\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture22-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture22-1-300x251.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the list of tasks of the&nbsp;<strong>Dev<\/strong>&nbsp;stage, in the&nbsp;<strong>AKS deployment<\/strong>&nbsp;job section, select the&nbsp;<strong>Create Deployments &amp; Services in AKS<\/strong>&nbsp;task.<\/li>\n\n\n\n<li>On the&nbsp;<strong>Kubectl<\/strong>&nbsp;pane on the right side, in the&nbsp;<strong>Azure Subscription<\/strong>&nbsp;dropdown list, select the entry representing the same Azure service connection, in the&nbsp;<strong>Resource group<\/strong>&nbsp;dropdown list, select the&nbsp;<strong>exceedm16l01a-RG<\/strong>&nbsp;entry, and in the&nbsp;<strong>Kubernetes cluster<\/strong>&nbsp;dropdown list, select the entry representing the AKS cluster you deployed earlier in this lab.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"548\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture23-1.png\" alt=\"\" class=\"wp-image-3404\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture23-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture23-1-300x263.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the list of tasks of the&nbsp;<strong>Dev<\/strong>&nbsp;stage, in the&nbsp;<strong>AKS deployment<\/strong>&nbsp;job section, with the&nbsp;<strong>Create Deployments &amp; Services in AKS<\/strong>&nbsp;task selected, on the&nbsp;<strong>Kubectl<\/strong>&nbsp;pane on the right side, scroll down to and expand the&nbsp;<strong>Secrets<\/strong>&nbsp;section, in the&nbsp;<strong>Azure subscription<\/strong>&nbsp;dropdown list, select the entry representing the same Azure service connection, and, in the&nbsp;<strong>Azure container registry<\/strong>&nbsp;dropdown list, select the entry representing the Azure Container registry you created earlier in this lab.<\/li>\n\n\n\n<li>Repeat the two previous steps for the&nbsp;<strong>Update image in AKS<\/strong>&nbsp;task.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: The&nbsp;<strong>Create Deployments &amp; Services in AKS<\/strong>&nbsp;task will create the required deployments and services in AKS as per the configuration specified in&nbsp;<strong>mhc-aks.yaml<\/strong>&nbsp;file. The pod will pull the latest Docker image.<\/p>\n\n\n\n<p><strong>Note<\/strong>: The&nbsp;<strong>Update image in AKS<\/strong>&nbsp;task will pull the required image corresponding to the BuildID from the designated repository and deploy that image to the&nbsp;<strong>mhc-front pod<\/strong>&nbsp;running in AKS.<\/p>\n\n\n\n<p><strong>Note<\/strong>: A secret called&nbsp;<strong>mysecretkey<\/strong>&nbsp;is created in AKS cluster through Azure DevOps by using command&nbsp;kubectl create secret&nbsp;in the background. This secret will be used to authorize access to the Azure Container Registry in order to pull the myhealth.web image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"519\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture24-1.png\" alt=\"\" class=\"wp-image-3405\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture24-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture24-1-300x250.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>On the&nbsp;<strong>Tasks<\/strong>&nbsp;pane of the&nbsp;<strong>Dev<\/strong>&nbsp;stage of the&nbsp;<strong>MyHealth.AKS.Release<\/strong>&nbsp;release pipeline, click the&nbsp;<strong>Variables<\/strong>&nbsp;tab.<\/li>\n\n\n\n<li>In the list of the&nbsp;<strong>Pipeline variables<\/strong>, update the value of the&nbsp;<strong>ACR<\/strong>&nbsp;variable to the Azure Container Registry name you recorded at the end of the previous task.<\/li>\n\n\n\n<li>In the list of the&nbsp;<strong>Pipeline variables<\/strong>, update the values of the&nbsp;<strong>SQLserver<\/strong>&nbsp;variable to the name of the logical server you recorded at the end of the previous task (SQLPassword is&nbsp;<strong>P2ssw0rd1234<\/strong>, SQLuser is&nbsp;<strong>sqladmin<\/strong>, DatabaseName is&nbsp;<strong>mhcdb<\/strong>).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"291\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture25-1.png\" alt=\"\" class=\"wp-image-3406\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture25-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture25-1-300x140.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the upper right corner of the&nbsp;<strong>All pipelines \/ MyHealth.AKS.Release<\/strong>&nbsp;pane, click&nbsp;<strong>Save<\/strong>, and, when prompted, click&nbsp;<strong>Save<\/strong>&nbsp;again to save the changes.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: In the list of pipeline variables,&nbsp;<strong>DatabaseName<\/strong>&nbsp;is set to&nbsp;<strong>mhcdb<\/strong>,&nbsp;<strong>SQLuser<\/strong>&nbsp;is set to&nbsp;<strong>sqladmin<\/strong>, and&nbsp;<strong>SQLpassword<\/strong>&nbsp;is set to&nbsp;<strong>P2ssw0rd1234<\/strong>. If you entered different values when creating the Azure SQL database earlier in this lab, update the values of the variables accordingly.<\/p>\n\n\n\n<p>Task 3: Trigger the build and release pipelines<\/p>\n\n\n\n<p>In this task, you will trigger the build and release pipelines and validate their completion.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>In the web browser window displaying the Azure DevOps portal, in the vertical menu bar at the far left of the Azure DevOps portal, in the&nbsp;<strong>Pipelines<\/strong>&nbsp;section, click&nbsp;<strong>Pipelines<\/strong>.<\/li>\n\n\n\n<li>On the&nbsp;<strong>Pipelines<\/strong>&nbsp;pane,&nbsp;<strong>All<\/strong>&nbsp;option, select the&nbsp;<strong>MyHealth.AKS.build<\/strong>&nbsp;pipeline, on the&nbsp;<strong>MyHealth.AKS.build<\/strong>&nbsp;pane, click&nbsp;<strong>Run pipeline<\/strong>, and, on the&nbsp;<strong>Run pipeline<\/strong>&nbsp;pane, click&nbsp;<strong>Run<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"317\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture26-1.png\" alt=\"\" class=\"wp-image-3407\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture26-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture26-1-300x152.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>On the build pipeline run pane, in the&nbsp;<strong>Jobs<\/strong>&nbsp;section, click&nbsp;<strong>Phase 1<\/strong>&nbsp;and monitor the progress of the build process.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"446\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture27-1.png\" alt=\"\" class=\"wp-image-3408\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture27-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture27-1-300x214.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"368\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture28-1.png\" alt=\"\" class=\"wp-image-3409\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture28-1.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture28-1-300x177.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><strong>Note<\/strong>: The build will generate and push the Docker image to ACR. After the build completes, you can review the build summary.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>To review the generated images, switch to the web browser window displaying the Azure portal.<\/li>\n\n\n\n<li>In the Azure portal, search for and select the&nbsp;<strong>Container registries<\/strong>&nbsp;resource type and, on the&nbsp;<strong>Container registries<\/strong>&nbsp;blade, select the Azure Container registry you created earlier in this lab.<\/li>\n\n\n\n<li>On the Azure Container registry blade, in the&nbsp;<strong>Services<\/strong>&nbsp;section, click&nbsp;<strong>Repositories<\/strong>&nbsp;and verify that the list of repositories includes the&nbsp;<strong>myhealth.web<\/strong>&nbsp;entry.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"430\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture29.png\" alt=\"\" class=\"wp-image-3410\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture29.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture29-300x207.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Switch back to the web browser window displaying the Azure DevOps portal.<\/li>\n\n\n\n<li>In the vertical menu bar at the far left of the Azure DevOps portal, in the&nbsp;<strong>Pipelines<\/strong>&nbsp;section, click&nbsp;<strong>Releases<\/strong>&nbsp;and, on the&nbsp;<strong>MyHealth.AKS.Release<\/strong>&nbsp;blade, click the latest release, and select the&nbsp;<strong>In progress<\/strong>&nbsp;link to monitor the progress of the release.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"449\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture30.png\" alt=\"\" class=\"wp-image-3411\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture30.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture30-300x216.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Once the release is complete, switch to the web browser window displaying the Azure portal.<\/li>\n\n\n\n<li>In the Azure portal, in the toolbar, click the&nbsp;<strong>Cloud Shell<\/strong>&nbsp;icon located directly to the right of the search text box.<\/li>\n\n\n\n<li>From the Bash session in the Cloud Shell pane, run the following to gain access to the AKS cluster you deployed earlier in this lab:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RGNAME=exceedm16l01a-RG\nAKSNAME=$(az aks list --resource-group $RGNAME --query '&#91;].name' --output tsv)\naz aks get-credentials --resource-group $RGNAME --name $AKSNAME\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"216\" src=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture31.png\" alt=\"\" class=\"wp-image-3412\" srcset=\"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture31.png 624w, https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/Picture31-300x104.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the Bash session in the Cloud Shell pane, run the following to list the pods running in AKS that were deployed by using the release pipeline:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pods<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>From the Bash session in the Cloud Shell pane, run the following to list the load balancer service that provides an external IP address via which you can access the containerized application:<\/li>\n<\/ul>\n\n\n\n<p>CodeCopy<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get service mhc-front --watch<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: Our application is designed to be deployed in the pod with the load balancer service providing external connectivity.<\/p>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\">\n<li>Note the value of the IP address in the&nbsp;<strong>External-IP<\/strong>&nbsp;column in the output of the command, open a new web browser tab, browse to that IP address, and verify that the&nbsp;<strong>MyHealthClinic<\/strong>&nbsp;application is running.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note<\/strong>: Kubernetes includes a web dashboard that can be used for basic management operations. This dashboard lets you view basic health status and metrics for your applications, create and deploy services, and edit existing applications. Follow&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/aks\/kubernetes-dashboard\">Microsoft Docs<\/a>&nbsp;to access the Kubernetes web dashboard in Azure Kubernetes Service (AKS).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Review<\/strong><\/p>\n\n\n\n<p>In this lab, you learned how to use Azure DevOps to deploy a containerized ASP.NET Core web application&nbsp;<strong>MyHealthClinic<\/strong>&nbsp;(MHC) to an AKS cluster.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><mark class=\"kt-highlight\">Reminder: Don\u2019t forget to delete or shutdown all unused Azure resources after your labs for cost saving<\/mark><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure Kubernetes Service (AKS)&nbsp;is the quickest way to use Kubernetes on Azure.&nbsp;Azure Kubernetes Service (AKS)&nbsp;manages your hosted Kubernetes environment, making it straightforward to deploy and manage containerized applications without requiring container orchestration expertise. It also enhances agility, scalability, and availability &hellip; <a href=\"https:\/\/exceedthecloud.com\/?p=3380\">Continued<\/a><\/p>\n","protected":false},"author":1,"featured_media":3415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"kt_blocks_editor_width":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[124,16,98,4],"tags":[8,105,117],"class_list":["post-3380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-devops","category-powershell","category-practical-labs-series","tag-azure","tag-devops","tag-kubernetes"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/exceedthecloud.com\/wp-content\/uploads\/2022\/06\/istockphoto-1366493158-612x612-2.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3380"}],"version-history":[{"count":3,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3380\/revisions"}],"predecessor-version":[{"id":3489,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/posts\/3380\/revisions\/3489"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=\/wp\/v2\/media\/3415"}],"wp:attachment":[{"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceedthecloud.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}