<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Containers on Azure Readiness starts here...</title><link>https://www.pdtit.be/tags/containers/</link><description>Recent content in Containers on Azure Readiness starts here...</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 15 Mar 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://www.pdtit.be/tags/containers/index.xml" rel="self" type="application/rss+xml"/><item><title>Azure Spring Clean - DCK, ACR, ACI, AKS, ACA, the Azure Container Alphabet Soup</title><link>https://www.pdtit.be/post/dck-acr-aci-aks-aca-the-azure-container-alphabet-soup/</link><pubDate>Wed, 15 Mar 2023 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/dck-acr-aci-aks-aca-the-azure-container-alphabet-soup/</guid><description>&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-09aa3df6.png"
 
 
 loading="lazy"
 
 alt="Azure Spring Clean"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Hey friends,&lt;/p&gt;
&lt;p&gt;Welcome to #AzureSpringClean, an initiative from &lt;strong&gt;&lt;a class="link" href="https://twitter.com/wedoazure" target="_blank" rel="noopener"
 &gt;Joe Carlyle&lt;/a&gt; and &lt;a class="link" href="https://twitter.com/tamstar1234" target="_blank" rel="noopener"
 &gt;Thomas Thornton&lt;/a&gt;&lt;/strong&gt;
where I&amp;rsquo;m honored to be able to participate in again for the 4th year already. Thanks guys for trusting me once more for sharing some Azure knowledge&amp;hellip;&lt;/p&gt;
&lt;p&gt;This time, I wanted to try and guide you through the buzzword of the last couple of years, &lt;strong&gt;containers&lt;/strong&gt;&amp;hellip; and more specifically, what different options you have in Azure to run your containerized workloads.&lt;/p&gt;
&lt;p&gt;Containerization has become a popular way to deploy applications in the cloud, offering benefits such as scalability, portability, and reliability. Azure, Microsoft&amp;rsquo;s cloud platform, offers several services that allow running containerized workloads, each with its own strengths and limitations. In this article, we will explore the different Azure services for container orchestration and management, including Azure Container Instance, Azure Kubernetes Services, Azure App Services, and Azure Container Apps.&lt;/p&gt;
&lt;p&gt;The starting point of a containerized workload, is having, or building a &lt;strong&gt;&lt;a class="link" href="https://www.docker.com" target="_blank" rel="noopener"
 &gt;Docker&lt;/a&gt;&lt;/strong&gt; container image.&lt;/p&gt;
&lt;h2 id="docker--docker-desktop"&gt;Docker &amp;amp; Docker Desktop
&lt;/h2&gt;&lt;p&gt;Docker is a popular platform for building, shipping, and running containerized applications. It provides a consistent environment for developers and operators to develop and deploy applications across different platforms and infrastructures. Docker makes it easy to package applications and their dependencies into portable container images, which can be run on any machine that supports Docker.&lt;/p&gt;
&lt;p&gt;Docker containers are lightweight, standalone, and executable packages of software that include everything needed to run an application. They contain the application code, runtime, system tools, libraries, and settings, making them highly portable and efficient. Docker containers run in isolation from the host operating system, providing consistent behavior and preventing conflicts with other applications.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-8e5673d1.png"
 
 
 loading="lazy"
 
 alt="Containers vs Virtual Machines"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Docker Desktop is a desktop application for Windows and macOS that provides a complete development environment for building and testing Docker applications. It includes the Docker Engine, Docker CLI, and a GUI-based interface for managing containers, images, and networks. With Docker Desktop, developers can easily build, test, and run Docker applications on their local machines, without having to set up a separate environment.&lt;/p&gt;
&lt;p&gt;Docker Desktop provides a simple and intuitive user interface for managing Docker images and containers. It allows developers to create, edit, and run Docker containers with just a few clicks. Developers can also use Docker Desktop to deploy applications to remote Docker hosts, such as cloud-based container orchestration platforms like Kubernetes.&lt;/p&gt;
&lt;p&gt;One of the major benefits of Docker Desktop is its ability to provide a consistent development environment across different platforms and operating systems. It eliminates the need for developers to set up and maintain complex development environments on their own machines, which can be time-consuming and error-prone. Docker Desktop also supports popular programming languages and frameworks, such as Java, Node.js, Python, and Ruby, making it a versatile tool for building modern applications.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-8e7274ef.png"
 
 
 loading="lazy"
 
 alt="Docker Desktop"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Overall, Docker and Docker Desktop provide a powerful platform for building, shipping, and running containerized applications. They simplify the development and deployment of applications, provide a consistent environment across different platforms, and offer a flexible and scalable way to build modern applications. With the continued growth of containerization, Docker and Docker Desktop are essential tools for any developer or operator looking to stay ahead in the rapidly evolving world of software development.&lt;/p&gt;
&lt;p&gt;For more information on Docker and Docker Desktop, head over to the &lt;a class="link" href="https://www.docker.com/products/docker-desktop/" target="_blank" rel="noopener"
 &gt;Docker Downloads&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want a sample container to test your Docker / Docker Desktop, feel free to use &lt;a class="link" href="https://hub.docker.com/r/pdetender/eshopwebmvc" target="_blank" rel="noopener"
 &gt;my sample e-commerce workload container&lt;/a&gt;, which runs a sample .NET6 web app&lt;/p&gt;
&lt;p&gt;Now you have your Docker environment ready to use, let&amp;rsquo;s take the next step, moving the container image into Azure.&lt;/p&gt;
&lt;h2 id="azure-container-registry-acr-"&gt;Azure Container Registry (ACR) (&lt;a class="link" href="https://learn.microsoft.com/en-us/azure/container-registry/" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/container-registry/&lt;/a&gt;)
&lt;/h2&gt;&lt;p&gt;ACR is a managed private registry for storing and managing container images in the cloud. With ACR, you can store and manage Docker images for all of your containerized applications, making it easy to deploy and manage them in the cloud.&lt;/p&gt;
&lt;p&gt;The purpose of ACR is to provide a secure and reliable way to store, manage, and deploy container images. By using ACR, you can ensure that your container images are stored securely in the cloud, and that only authorized users have access to them. ACR also provides built-in integration with all other Azure Container Services (see below), making it easy to deploy your container images across the different services.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-3c7a6c82.png"
 
 
 loading="lazy"
 
 alt="Azure Container Registry"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;ACR supports Docker Hub as well as DevOps environments as sources for container images, and it provides a seamless experience for pushing and pulling images from the registry. ACR also supports advanced features, such as geo-replication and image security vulnerability scanning, which allows you to replicate your images to multiple regions for high availability and scan your images for security vulnerabilities (Backed by Defender for Containers and Defender for Cloud).&lt;/p&gt;
&lt;p&gt;In summary, ACR serves as a central repository for storing and managing your container images, making it easy to deploy and manage your containerized applications in the cloud. It provides a secure and reliable way to store your images, with built-in integration with other Azure container services for easy deployment.&lt;/p&gt;
&lt;p&gt;Some sample Azure CLI code to get you started:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az acr create --resource-group myresourcegroup --name myacr --sku Basic
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Once you run this command, Azure will create a new ACR with the specified name and SKU in the specified resource group. You can then use the ACR to store and manage your container images.&lt;/p&gt;
&lt;p&gt;With the ACR being ready, it&amp;rsquo;s time to upload (&lt;strong&gt;push&lt;/strong&gt;) the Docker image into the registry. Here are a few steps to get you started:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az login
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az acr login --name myacr
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Before you can push a Docker image to the Azure Container Registry, it needs to be updated with the name of the registry. You can use &lt;strong&gt;Docker tag&lt;/strong&gt; command to help with this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker tag pdetender/eshopwebmvc myacr.azurecr.io/eshopwebmvc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;followed by:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker push myacr.azurecr.io/eshopwebmvc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;wait for the upload to complete.&lt;/p&gt;
&lt;h2 id="azure-container-instance-aci-"&gt;Azure Container Instance (ACI) (&lt;a class="link" href="https://learn.microsoft.com/en-us/azure/container-instances/" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/container-instances/&lt;/a&gt;)
&lt;/h2&gt;&lt;p&gt;Azure Container Instance (ACI) is a serverless solution for running containers in the cloud. With ACI, you can deploy and manage containers without worrying about the underlying infrastructure. ACI is an excellent choice for running short-lived containerized tasks that don&amp;rsquo;t require orchestration, such as batch processing, job scheduling, or testing.&lt;/p&gt;
&lt;p&gt;ACI is easy to use, as it doesn&amp;rsquo;t require any knowledge of container orchestration tools such as Kubernetes or Docker Swarm. Instead, you can use the Azure portal, Azure CLI, or Azure PowerShell to deploy and manage your containers.&lt;/p&gt;
&lt;p&gt;One of the strengths of ACI is its cost-effectiveness. With ACI, you only pay for the exact amount of compute and memory resources that your containerized tasks require, measured in seconds. This makes ACI an ideal solution for running sporadic, bursty workloads.&lt;/p&gt;
&lt;p&gt;However, ACI has some limitations. First, ACI only supports running single containers or multi-container groups, not entire applications. Second, ACI doesn&amp;rsquo;t provide advanced features such as automatic scaling, self-healing, or load balancing. Finally, ACI has limited networking capabilities, as it doesn&amp;rsquo;t support virtual networks or custom IP addresses.&lt;/p&gt;
&lt;p&gt;with the EshopOnWeb Docker image uploaded to the Azure Container Registry, use the following Az CLI command to deploy an Azure Container Instance:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az container create --resource-group myResourceGroup --name aci-springclean-app --image myacr.azurecr.io/eshopwebmvc --cpu 1 --memory 1 --registry-login-server myacr.azurecr.io --ip-address Public --dns-name-label aci-springclean-app --ports 80
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-bced3608.png"
 
 
 loading="lazy"
 
 alt="Azure Container Instance"
 
 
 
 &gt;&lt;/p&gt;
&lt;h2 id="azure-kubernetes-services-aks-"&gt;Azure Kubernetes Services (AKS) (&lt;a class="link" href="https://learn.microsoft.com/en-us/azure/aks/intro-kubernetes" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/aks/intro-kubernetes&lt;/a&gt;)
&lt;/h2&gt;&lt;p&gt;Azure Kubernetes Services (AKS) is a managed Kubernetes service that allows you to deploy and manage containerized applications in the cloud. Kubernetes is a powerful open-source container orchestration tool that automates the deployment, scaling, and management of containerized workloads.&lt;/p&gt;
&lt;p&gt;AKS is an excellent choice for running complex, production-grade applications that require orchestration, such as microservices architectures or stateful applications. With AKS, you can take advantage of Kubernetes&amp;rsquo; advanced features, such as automatic scaling, self-healing, and rolling updates.&lt;/p&gt;
&lt;p&gt;AKS is easy to use, as it abstracts away the complexity of Kubernetes and provides an easy-to-use management interface. With AKS, you can deploy your Kubernetes clusters in minutes, using the Azure portal, Azure CLI, or Azure PowerShell.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-01712b28.png"
 
 
 loading="lazy"
 
 alt="Azure Kubernetes Services - AKS"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;One of the strengths of AKS is its scalability. With AKS, you can scale your clusters up or down based on demand, without worrying about the underlying infrastructure. AKS also provides advanced networking capabilities, such as virtual networks, load balancers, and custom IP addresses.&lt;/p&gt;
&lt;p&gt;However, AKS has some limitations. First, AKS is more expensive than ACI, as it requires more resources and management overhead. Second, AKS requires some knowledge of Kubernetes, which can be challenging for beginners. Finally, AKS may have some limitations in terms of customization, as it is a managed service that abstracts away some of the lower-level details of Kubernetes.&lt;/p&gt;
&lt;p&gt;Here are a few steps to get you started in deploying an AKS cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az aks create \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --resource-group myResourceGroup \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --name myAKSCluster \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --node-count 2 \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --generate-ssh-keys \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --attach-acr &amp;lt;acrName&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Deployment should take about 10-15 minutes, depending on the Azure region.&lt;/p&gt;
&lt;p&gt;Once the AKS service is up-and-running, you can manage it using &lt;strong&gt;kubectl&lt;/strong&gt;, the Kubernetes Command Line interface.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az aks install-cli
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Next, connect to the cluster from Kubectl&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;From here, you can validate the Kubernetes cluster nodes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get nodes
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ kubectl get nodes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME STATUS ROLES AGE VERSION
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aks-nodepool1-37463671-vmss000000 Ready agent 2m37s v1.18.10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aks-nodepool1-37463671-vmss000001 Ready agent 2m28s v1.18.10
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In order to get a containerized application runnig as a pod (=Kubernetes&amp;rsquo; terminology for a running container&amp;hellip;), you need to create a &lt;strong&gt;Kubernetes Manifest file&lt;/strong&gt;, which uses a YAML syntax format.&lt;/p&gt;
&lt;p&gt;There are a lot of options and configuration parameters possible, but below example should get you started:
&lt;strong&gt;replace the image name pdtacr&amp;hellip; with the name of your ACR image&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;span class="lnt"&gt;23
&lt;/span&gt;&lt;span class="lnt"&gt;24
&lt;/span&gt;&lt;span class="lnt"&gt;25
&lt;/span&gt;&lt;span class="lnt"&gt;26
&lt;/span&gt;&lt;span class="lnt"&gt;27
&lt;/span&gt;&lt;span class="lnt"&gt;28
&lt;/span&gt;&lt;span class="lnt"&gt;29
&lt;/span&gt;&lt;span class="lnt"&gt;30
&lt;/span&gt;&lt;span class="lnt"&gt;31
&lt;/span&gt;&lt;span class="lnt"&gt;32
&lt;/span&gt;&lt;span class="lnt"&gt;33
&lt;/span&gt;&lt;span class="lnt"&gt;34
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apiVersion: apps/v1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kind: Deployment
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;metadata:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name: secsample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;spec:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; replicas: 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; selector: 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; matchLabels:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; app: secsample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; template:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; metadata:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; labels:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; app: secsample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; spec:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; containers:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - name: secsample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; image: pdtacr.azurecr.io/simplcdotnet31:latest
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ports:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - containerPort: 80
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; imagePullSecrets:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - name: acr-auth
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apiVersion: v1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kind: Service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;metadata:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name: secsample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;spec:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; type: LoadBalancer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ports:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - port: 80
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; selector:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; app: secsample
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This deploys 3 pods (replicas parameter) of the same container, across the 2 nodes in the cluster. The service will get published behind the default Azure Load Balancer, running on port 80. You can verify this later on using the public IP address of the service.&lt;/p&gt;
&lt;p&gt;Save the above file to your local machine, for example &lt;strong&gt;springcleanaks.yaml&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;use kubectl to import/inject the YAML configuration into the AKS cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl apply -f springcleanaks.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After a few minutes, validate the running service by running the following kubectl command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get service secsample --watch
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If the IP-address mentions &amp;ldquo;pending&amp;rdquo;, give it a bit more time to load. Run the above command once more.&lt;/p&gt;
&lt;p&gt;The outcome should know show both the internal pod IP, as well as the public IP. Open the browser to connect to the web application.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;secsample LoadBalancer 10.0.33.125 24.17.23.13 80:30676/TCP 67s
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you want to play with the AKS Autoscaling features, I can recommend the following &lt;strong&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/azure/aks/tutorial-kubernetes-scale?tabs=azure-cli" target="_blank" rel="noopener"
 &gt;Microsoft Learn tutorial&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Awesome, you are making good progress&amp;hellip;&lt;/p&gt;
&lt;p&gt;One could think you won&amp;rsquo;t need anything more than AKS, as it provides better high-availability, scalability as well as several other features, compared to the more standard Azure Container Instance. But you are wrong. While AKS is probably one of the more popular (if not the most popular&amp;hellip;) ways to run containerized workloads in Azure, it is sometimes complex, overwhelming, and just &amp;ldquo;too much&amp;rdquo; for what you need.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s have a look at 2 more services&amp;hellip;&lt;/p&gt;
&lt;h2 id="azure-app-services-"&gt;Azure App Services (&lt;a class="link" href="https://learn.microsoft.com/en-us/training/modules/deploy-run-container-app-service/" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/training/modules/deploy-run-container-app-service/&lt;/a&gt;)
&lt;/h2&gt;&lt;p&gt;Azure App Service is a platform-as-a-service (PaaS) offering that allows developers to build, deploy, and scale web applications and APIs quickly and easily. With App Service, developers can deploy web apps and APIs written in various programming languages, including .NET, Java, Node.js, Python, and PHP, among others. App Service provides built-in DevOps capabilities and integration with other Azure services, such as Azure SQL Database, Azure Redis Cache, and Azure Storage.&lt;/p&gt;
&lt;p&gt;One of the features of Azure App Service is the ability to run Docker containers. Developers can package their application and its dependencies into a Docker image and deploy it to Azure App Service. Azure App Service can then run the Docker image as a container, providing all the benefits of containerization, such as portability, scalability, and isolation.&lt;/p&gt;
&lt;p&gt;Some of the benefits of running Docker containers in Azure App Service include:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Easy deployment: With App Service, developers can deploy their Docker containers quickly and easily using various deployment options, such as Git, GitHub, Azure DevOps, or the Azure Portal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;High availability: App Service provides built-in high availability, scaling, and load balancing capabilities, ensuring that containers are always available and responsive to incoming traffic.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Platform integration: App Service integrates with other Azure services, such as Azure SQL Database, Azure Redis Cache, and Azure Storage, making it easy to build end-to-end solutions with minimal effort.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Security: App Service provides a secure and isolated environment for running Docker containers, with features such as network isolation, private networking, and Azure Active Directory authentication.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, Azure App Service is not the same as the previously discussed Azure Kubernetes Service (AKS), which is a container orchestration platform. AKS is designed for running and managing containerized applications at scale, with features such as automatic scaling, rolling updates, and self-healing. AKS is typically used for more complex applications that require multiple containers and need to be deployed across multiple nodes.&lt;/p&gt;
&lt;p&gt;In summary, Azure App Service provides an easy and convenient way to run Docker containers in a PaaS environment, with built-in high availability, scalability, and integration with other Azure services. AKS, on the other hand, is a container orchestration platform designed for running and managing containerized applications at scale, with features such as automatic scaling, rolling updates, and self-healing.&lt;/p&gt;
&lt;p&gt;The following Azure CLI code is what you need to get started with running a Docker image as an App Service:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create a resource group
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az group create --name myResourceGroup --location eastus
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create an App Service plan
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku B1 --is-linux
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create an App Service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az webapp create --name myAppService --plan myAppServicePlan --resource-group myResourceGroup --deployment-container-image-name &amp;lt;acr-name&amp;gt;.azurecr.io/&amp;lt;container-image-name&amp;gt;:&amp;lt;tag&amp;gt; --docker-registry-server-url https://&amp;lt;acr-name&amp;gt;.azurecr.io --docker-registry-server-user &amp;lt;acr-name&amp;gt; --docker-registry-server-password &amp;lt;acr-access-token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Configure the App Service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az webapp config appsettings set --name myAppService --resource-group myResourceGroup --settings DOCKER_CUSTOM_IMAGE_NAME=&amp;lt;acr-name&amp;gt;.azurecr.io/&amp;lt;container-image-name&amp;gt;:&amp;lt;tag&amp;gt; WEBSITES_PORT=80
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Set up continuous deployment
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az webapp deployment container config --name myAppService --resource-group myResourceGroup --enable-cd true --docker-registry-server-url https://&amp;lt;acr-name&amp;gt;.azurecr.io --docker-registry-server-user &amp;lt;acr-name&amp;gt; --docker-registry-server-password &amp;lt;acr-access-token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-730170f4.png"
 
 
 loading="lazy"
 
 alt="Azure App Service - Docker Settings"
 
 
 
 &gt;&lt;/p&gt;
&lt;h2 id="azure-container-apps-"&gt;Azure Container Apps (&lt;a class="link" href="https://learn.microsoft.com/en-us/azure/container-apps/overview" target="_blank" rel="noopener"
 &gt;https://learn.microsoft.com/en-us/azure/container-apps/overview&lt;/a&gt;)
&lt;/h2&gt;&lt;p&gt;Azure Container Apps is a serverless platform for deploying and managing containerized applications. It is designed to simplify the deployment and management of microservices-based applications by providing a seamless experience for developers and operators.&lt;/p&gt;
&lt;p&gt;With Azure Container Apps, you can deploy and manage multiple containers as part of a single application, without worrying about the underlying infrastructure. This makes it an excellent choice for running complex, multi-container applications that require orchestration.&lt;/p&gt;
&lt;p&gt;One of the strengths of Azure Container Apps is its flexibility. With Azure Container Apps, you can use any container image from any registry, including Docker Hub, Azure Container Registry, or your own private registry. You can also define your application&amp;rsquo;s infrastructure as code using YAML or JSON files, which allows you to version control and automate the deployment process.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-cd50dd87.png"
 
 
 loading="lazy"
 
 alt="Azure Container Apps - Docker Settings"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Azure Container Apps also provides advanced features, such as automatic scaling, self-healing, and application-level load balancing. With Azure Container Apps, you can scale your application automatically based on demand, and Azure will handle the underlying infrastructure for you.&lt;/p&gt;
&lt;p&gt;However, Azure Container Apps has some limitations. First, Azure Container Apps is still in preview, so it may not be suitable for production-grade applications. Second, Azure Container Apps has some limitations in terms of customization, as it abstracts away some of the lower-level details of container orchestration. Finally, Azure Container Apps has a pricing model that may be more expensive than other Azure container services, as it charges based on the number of requests processed by your application.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2023-03-15-af35650d.png"
 
 
 loading="lazy"
 
 alt="Azure Container Apps - Scale Settings"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Use the following code example to get started with deploying an Azure Container Apps scenario:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az containerapp create -n MyContainerapp -g MyResourceGroup --image myregistry.azurecr.io/myimage:latest --environment MyContainerappEnv --cpu 0.5 --memory 1.0Gi --min-replicas 4 --max-replicas 8
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;As you can see, Azure offers several services that allow running containerized workloads, each with its own strengths and limitations. In this article, I walked you through different Azure services for container orchestration and management, including Azure Container Instance, Azure Kubernetes Services, Azure App Services, and Azure Container Apps. I tried to give you a few Azure CLI commands to get started and deploy baseline examples. This should allow you to validate your own opinions around which container service scenario to use for your specific business-critical or testing workloads.&lt;/p&gt;
&lt;p&gt;I hope you learned something from reading the article, enjoy the rest of the &lt;a class="link" href="https://www.azurespringclean.com" target="_blank" rel="noopener"
 &gt;Azure Spring Clean&lt;/a&gt; topics!!&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2023-03-15-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers!!&lt;/p&gt;
&lt;p&gt;/Peter&lt;/p&gt;</description></item><item><title>Upgrading an AKS cluster in 20 min</title><link>https://www.pdtit.be/post/upgrading_aks_in_20min/</link><pubDate>Fri, 18 Jun 2021 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/upgrading_aks_in_20min/</guid><description>&lt;p&gt;Ever since I joined Microsoft (Sept 2019) and started working in the Azure Technical Trainer team, I deployed a demo &lt;strong&gt;&lt;a class="link" href="https://azure.microsoft.com/en-us/services/kubernetes-service/" target="_blank" rel="noopener"
 &gt;Azure Kubernetes Service (AKS)&lt;/a&gt;&lt;/strong&gt; with a few sample containers. Helping me in walking training attendees through the architecture, the management concepts and what it takes to run containerized workloads using the advanced capabilities coming with Kubernetes on Azure.&lt;/p&gt;
&lt;p&gt;Knowing this AKS cluster got deployed about 20 months back, it also meant my setup was getting &lt;em&gt;a little bit out-of-date&lt;/em&gt;. Interesting enough, it ran for almost 500 days (I considered waiting to publish this article to celebrate its anniversary&amp;hellip;)&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-06-18-c7047e4f.png"
 
 
 loading="lazy"
 
 alt="AKS Running 500 days"
 
 
 
 &gt;&lt;/p&gt;
&lt;h2 id="version-strategy"&gt;Version strategy
&lt;/h2&gt;&lt;p&gt;AKS is following the overall Kubernetes supportability in regards to versioning. More details from the below links in the docs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://docs.microsoft.com/en-us/azure/aks/support-policies" target="_blank" rel="noopener"
 &gt;https://docs.microsoft.com/en-us/azure/aks/support-policies&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://github.com/Azure/AKS/releases" target="_blank" rel="noopener"
 &gt;https://github.com/Azure/AKS/releases&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a class="link" href="https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions" target="_blank" rel="noopener"
 &gt;https://docs.microsoft.com/en-us/azure/aks/supported-kubernetes-versions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In short, the Kubernetes community released minor versions about every 3 months, and major releases every 9 months approximately. As of version 1.19, this got extended to 12 months support.&lt;/p&gt;
&lt;p&gt;What this means, is that you see a list of &amp;ldquo;versions&amp;rdquo; available in Azure, for both new and existing deployments of AKS environments. At the time of deploying my cluster, it seems the active version was 1.7.7 (I could pull this up from my AKS Resource Group / Deployment history)&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-06-18-880b8d37.png"
 
 
 loading="lazy"
 
 alt="AKS deployed version"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;I assume I picked the [default] version at the time of deploying, which would mean there were 3 minor versions before, and 3 minor versions ahead.&lt;/p&gt;
&lt;h2 id="version-118-end-of-life"&gt;Version 1.18 End of Life
&lt;/h2&gt;&lt;p&gt;Earlier this week, I got an internal note from our back-end security team, informing me about the AKS version 1.18 getting deprecated by June 30th, 2021 (yes, in about 2 weeks from now), and I needed to upgrade to &lt;em&gt;at least 1.19&lt;/em&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/Azure/AKS/releases" target="_blank" rel="noopener"
 &gt;https://github.com/Azure/AKS/releases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="upgrade-process"&gt;Upgrade Process
&lt;/h2&gt;&lt;p&gt;One of the core strenghts of Kubernetes (AKS and other flavors) is how it handles seamless upgrades of its worker nodes. In short, each worker node in the cluster gets upgraded, and introduced to the cluster only when all health checks have passed successfully. If something would go wrong, the upgrade won&amp;rsquo;t be flagged - but your running containers won&amp;rsquo;t even notice any interruption either. After a successful upgrade of an existing (or introduction of a new) node to the cluster, your containerized workloads will just be started and running as expected.&lt;/p&gt;
&lt;p&gt;To safe me from near-future upgrade tasks, I decided I wanted to upgrade to the most current version available (1.20.7 in my case). Which meant performing a &amp;ldquo;double&amp;rdquo; upgrade, from 1.18 major version to 1.19 major version, followed by another upgrade to the 1.20 major version.&lt;/p&gt;
&lt;p&gt;I used the portal for these steps, as they are &lt;strong&gt;really&lt;/strong&gt; easy to perform, but know Azure CLI or template based scenarios are also an option.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the Azure Portal, browse to your AKS cluster resource. In the &lt;strong&gt;Overview&lt;/strong&gt; section, notice the &amp;ldquo;Kubernetes version&amp;rdquo; parameter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the version number; this brings you to the upgrade blade&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-06-18-509dc046.png"
 
 
 loading="lazy"
 
 alt="AKS deployed version"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Upgrade Version&lt;/strong&gt; and choose the version of choice. (In my case, the highest was 1.19.11). I also selected to upgrade &lt;strong&gt;control plane + all node pools&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Confirm&lt;/strong&gt; and wait for the upgrade process to kick off and complete successfully. This took about &lt;strong&gt;6 minutes&lt;/strong&gt; in my case.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-06-18-48d4c2b6.png"
 
 
 loading="lazy"
 
 alt="AKS deployed version"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;Once this version 1.19.11 upgrade was done, I moved on with repeating the same steps, but this time selecting &lt;strong&gt;version 1.20.7&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-06-18-e6841f23.png"
 
 
 loading="lazy"
 
 alt="AKS deployed version"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="6"&gt;
&lt;li&gt;
&lt;p&gt;This process took another &lt;strong&gt;7-8 minutes&lt;/strong&gt; on my end.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;That&amp;rsquo;s all!!&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;In this article, I wanted to share some insights on the Kubernetes, and more specific AKS upgrade policy and process. Thanks to the architecture and orchestration of Kubernetes, upgrading versions is a rather smooth and almost seamless process. While it worked fine for a almost 18-month all cluster setup, I would definitely recommend keeping up with versions faster, instead of - what I did - waiting longer.&lt;/p&gt;
&lt;p&gt;Got any questions, don&amp;rsquo;t hesitate reaching out! &lt;a class="link" href="mailto:peter@pdtit.be" &gt;peter@pdtit.be&lt;/a&gt; or @pdtit on Twitter :)&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2021-06-18-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;/Peter&lt;/p&gt;</description></item><item><title>AKS ErrImagePull and ImagePullBackOff on AKS after a year</title><link>https://www.pdtit.be/post/renewing-expired-aks-service-principal/</link><pubDate>Tue, 23 Mar 2021 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/renewing-expired-aks-service-principal/</guid><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve deployed me an &lt;a class="link" href="https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-cluster" target="_blank" rel="noopener"
 &gt;AKS - Azure Kubernetes Service&lt;/a&gt; environment that I use in my Azure training class deliveries almost every week (yes, every AZ-course touches on AKS and Containers&amp;hellip;)&lt;/p&gt;
&lt;h2 id="the-problem"&gt;The Problem
&lt;/h2&gt;&lt;p&gt;My AKS environment was running fine all this time (a bit over a year), allowing me to rely on existing deployed Kubernetes services, as well as building new services as a live demo. Until this morning, where all of a sudden, my own services didn&amp;rsquo;t start at all, but the kube-system services did. The error message I noticed for this service was &lt;strong&gt;ImagePullBackOff&lt;/strong&gt; and &lt;strong&gt;ErrImagePull&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-03-23-0215f800.png"
 
 
 loading="lazy"
 
 alt="ImagePullBackOff"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;If you know a bit about Kubernetes and custom services (= the PODs that are running your containerized workloads), you know they are pulled from a Container Registry, in my case &lt;a class="link" href="https://azure.microsoft.com/en-us/services/container-registry/" target="_blank" rel="noopener"
 &gt;ACR - Azure Container Registry&lt;/a&gt;. Which means that in this scenario, there was probably something wrong with the communication between AKS and ACR. And more specifically, the AKS resource (or the Service Principal representing my AKS cluster) not having (no more having&amp;hellip;) the correct permissions to reach ACR. Interesting is that the Kubernetes system containers are still running fine.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![System_containers_up](../images/screenshot-2021-03-23-2744036e.png)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="the-fix"&gt;The fix
&lt;/h2&gt;&lt;p&gt;The fix consisted of a few different steps, but all in all, the steps made sense.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Check if the current AKS Service Principal was still valid&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After facing the problem, it struck me&amp;hellip; an AKS Service Principal is valid for 1 year. Yes, my AKS cluster had been deployed for a bit more than year (405 days). So yes, &lt;strong&gt;my SP got expired&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-03-23-ee2a2487.png"
 
 
 loading="lazy"
 
 alt="NameSpace_Uptime"
 
 
 
 &gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Although there is a way to &lt;strong&gt;renew the lifetime&lt;/strong&gt; of a Service Principal, I couldn&amp;rsquo;t rely on that mechanism, as it only works for a non-expired-yet SP. Sounds normal to me. (In real life scenarios, you could automate this renewal from Azure Functions or Azure Automation)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This left me with the next option, &lt;strong&gt;creating a new Service Principal&lt;/strong&gt; and linking it to the existing AKS Cluster Resource. Let&amp;rsquo;s go for that approach.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="get-the-resource-id-for-the-existing-aks-cluster"&gt;Get the resource ID for the existing AKS cluster
&lt;/h2&gt;&lt;p&gt;As we need to link a new Service Principal to the existing AKS Cluster, let&amp;rsquo;s check the resource ID by running the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SP_ID=$(az aks show --resource-group aksrg --name pdtaks\
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --query servicePrincipalProfile.clientId -o tsv)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az ad sp credential list --id $SP_ID --query &amp;#34;[].endDate&amp;#34; -o tsv
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Copy the output aside as we need it again later on.&lt;/p&gt;
&lt;h2 id="create-a-new-service-principal"&gt;Create a new Service Principal
&lt;/h2&gt;&lt;p&gt;To manually create a service principal with the Azure CLI, use the &lt;strong&gt;az ad sp create-for-rbac&lt;/strong&gt; command. By default, a Service Principal gets assigned to your subscription with Contributor rights, but this will change anytime soon. To avoid any misusage, add the &lt;strong&gt;&amp;ndash;skip-assignment&lt;/strong&gt; parameter to make sure the SP resource doesn&amp;rsquo;t get any assignments yet:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az ad sp create-for-rbac --skip-assignment --name pdtakssp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Copy the output aside as we need it again later on.&lt;/p&gt;
&lt;h2 id="update-the-aks-cluster-with-the-new-service-principal"&gt;Update the AKS Cluster with the new Service Principal
&lt;/h2&gt;&lt;p&gt;Allocate the output of the Service Principal and link it to the variable &amp;ldquo;SP_ID&amp;rdquo;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SP_ID=f0ef702d-7108-476c-8129-XXXXXXXX
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Do the same for the Service Principal password: linking it to the variable &amp;ldquo;SP_SECRET&amp;rdquo;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SP_SECRET=gbKclLRCLy1R4B6SzJ~lNVF5eb5ATvP.9l
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Followed by the following command, which runs the actual update:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;az aks update-credentials \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --resource-group aksrg\
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --name pdtaks\
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --reset-service-principal \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --service-principal $SP_ID \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --client-secret $SP_SECRET
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After a few minutes, this process should be completed successfully.&lt;/p&gt;
&lt;h2 id="define-acrpush-permissions-rbac-for-this-new-service-principal"&gt;Define ACRPush permissions (RBAC) for this new Service Principal
&lt;/h2&gt;&lt;p&gt;The AKS Cluster got updated with the new Service Principal, but this resource cannot connect to the Azure Container Registry yet, as it is lacking the permissions to do so. But this can be fixed as follows (using the Portal approach, although CLI or PS could also do the trick):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From Azure Portal, browse to the Azure Container Registry you want to use&lt;/li&gt;
&lt;li&gt;Select Access Control (IAM)&lt;/li&gt;
&lt;li&gt;Select Add Role Assignment&lt;/li&gt;
&lt;li&gt;Role = ACRPush (Pull would only allow Pulling, Push allows both Pull and Push operations)&lt;/li&gt;
&lt;li&gt;Assign Access To = User, Group, Principal&lt;/li&gt;
&lt;li&gt;Select = search for the name of your Service Principal (pdtakssp in my example)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-03-23-3b2146dd.png"
 
 
 loading="lazy"
 
 alt="AcrPush_Permissions"
 
 
 
 &gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save the changes&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="validate-if-the-problem-got-fixed"&gt;Validate if the problem got fixed
&lt;/h2&gt;&lt;p&gt;AKS is pretty smart in retrying failed operations (it&amp;rsquo;s an Orchestrator after all ;). So let&amp;rsquo;s check if we fixed the problem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Browse to your AKS Cluster resource&lt;/li&gt;
&lt;li&gt;Select Services and Ingress&lt;/li&gt;
&lt;li&gt;All services, system and custom workloads, should be up and running again&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2021-03-23-5d9c0d99.png"
 
 
 loading="lazy"
 
 alt="AKS_Fixed"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Awesome, AKS did it! (With a little help from Azure Active Directory)&lt;/p&gt;
&lt;h2 id="lesson-learned"&gt;Lesson Learned
&lt;/h2&gt;&lt;p&gt;When deploying AKS Clusters in Azure, remember they get linked to a Service Principal (or Managed Identity alternatively), which is valid for 1 year, but allows for renewal (extend). If your Service Principal got expired, the fix is in creating a new Service Principal, linking it to the AKS Cluster and specifying AcrPush RBAC permissions for the Container Registry you want to use.&lt;/p&gt;
&lt;p&gt;Now I&amp;rsquo;m going to check on that automatic renewal or at least updating my calendar to renew my Service Principal in time next year.&lt;/p&gt;
&lt;p&gt;Take care for now, feel free to reach out on &lt;a class="link" href="https://twitter.com/pdtit" target="_blank" rel="noopener"
 &gt;Twitter&lt;/a&gt; or peter @ pdtit dot be for questions.&lt;/p&gt;
&lt;p&gt;thanks, Peter&lt;/p&gt;</description></item><item><title>The weird case of the Visual Studio 2019 Dockerfile</title><link>https://www.pdtit.be/post/the-weird-case-of-visualstudio2019-dockerfile/</link><pubDate>Sun, 22 Nov 2020 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/the-weird-case-of-visualstudio2019-dockerfile/</guid><description>&lt;p&gt;Hey there,&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been doing quite a lot with &lt;a class="link" href="http://www.docker.com" target="_blank" rel="noopener"
 &gt;Docker&lt;/a&gt; and the different Azure Container Services offerings like &lt;a class="link" href="https://azure.microsoft.com/en-us/services/container-instances/" target="_blank" rel="noopener"
 &gt;Azure Container Instance&lt;/a&gt; and &lt;a class="link" href="https://azure.microsoft.com/en-us/services/kubernetes-service/" target="_blank" rel="noopener"
 &gt;Azure Kubernetes Services&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As you probably know, the starting point of a containerized application is the Dockerfile. Look at this like an instruction script, which tells Docker what needs to happen, in order to grab the application source code, compile it and produce the container image.&lt;/p&gt;
&lt;p&gt;Besides the complexity of running containers by itself, I personally think writing a Dockerfile is equally difficult and complex. So I am more than happy to know that &lt;a class="link" href="https://www.visualstudio.com" target="_blank" rel="noopener"
 &gt;Visual Studio (2017 and 2019)&lt;/a&gt; comes with some interesting &lt;strong&gt;Container Tools&lt;/strong&gt;. Aside from helping in debugging containerized workloads, providing some interaction with the Docker engine, it also helps in compiling a Dockerfile for you.&lt;/p&gt;
&lt;p&gt;Or at least &amp;ldquo;it pretends&amp;rdquo;&amp;hellip; Read on to find out about my journey, messing around for 2,5 days before I actually got my Docker container working&amp;hellip;&lt;/p&gt;
&lt;h2 id="add-docker-support"&gt;Add Docker Support
&lt;/h2&gt;&lt;p&gt;When you run &lt;a class="link" href="https://www.docker.com/products/docker-desktop" target="_blank" rel="noopener"
 &gt;Docker Desktop&lt;/a&gt; on the same machine as your Visual Studio development environment, you don&amp;rsquo;t need to do anything. The integration is just there (I honestly never looked into the details how this works, but hey, it is there&amp;hellip;)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From &lt;strong&gt;VS2019 Solution Explorer&lt;/strong&gt;, &lt;strong&gt;right click&lt;/strong&gt; on the Project you want to containerize&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Add&amp;hellip;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Notice &lt;strong&gt;Docker Support&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-1595e451.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;
&lt;p&gt;From here, it prompts for the Operating System for the container workload, being &lt;strong&gt;Linux&lt;/strong&gt; or &lt;strong&gt;Windows&lt;/strong&gt;; I guess this depends on the app language you are using though; since, in my case, my sample app is using &lt;strong&gt;dotnetcore3.1&lt;/strong&gt;, which runs on both, I could choose.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From here, it produces the necessary &lt;strong&gt;Dockerfile&lt;/strong&gt;, looking like this:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-1e284d16.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="6"&gt;
&lt;li&gt;
&lt;p&gt;At first glance, &lt;strong&gt;all looks good&lt;/strong&gt;, right? This is what the Dockerfile is doing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Grab the ASP.NET 3.1 base container image and specify the work directory as /app, and expose the application on port 80 and 443; this makes total sense, as we are working with a web application here&lt;/li&gt;
&lt;li&gt;Next, grab the DotnetCore 3.1 SDK base container image and specify the work directory as /src&lt;/li&gt;
&lt;li&gt;Followed by copying my application source code into it&lt;/li&gt;
&lt;li&gt;From here, it runs the usual &lt;strong&gt;dotnet restore, build, publish&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Producing a final Docker image, which executes &lt;strong&gt;&amp;ldquo;dotnet&lt;/strong&gt; and start my &lt;strong&gt;SimplCommerce.Webhost&lt;/strong&gt; web application within the Docker Container.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At second glance, &lt;strong&gt;all still looked good&lt;/strong&gt;, where I was starting my container (F5). The &amp;ldquo;Build&amp;rdquo; process kicks off, similar to running this for a traditional code-based application, and going through the &lt;strong&gt;Docker compile&lt;/strong&gt; process as expected:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-630320b9.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="8"&gt;
&lt;li&gt;Once the build process is done, it switches to the &lt;strong&gt;Container Tools&lt;/strong&gt; view, exposing details about the actual running container (ports, logs,&amp;hellip;)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-93383e96.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="9"&gt;
&lt;li&gt;As well as showing a running application in the browser&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-005f6a04.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;h2 id="where-it-goes-wrong"&gt;Where it goes wrong
&lt;/h2&gt;&lt;p&gt;I was super excited at this point; I got my web application running, moved it into a working Docker Container, just by going through &lt;strong&gt;3 clicks&lt;/strong&gt;. Awesome!!&lt;/p&gt;
&lt;p&gt;Since the intention is to run my application outside of Visual Studio debug mode, I was obviously running a second test, by manually starting my container using the Docker command line.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Docker run -p 2500:80 fastcarcase:dev&lt;/strong&gt; is the command to kick off my container instance, and all seemed fine when checking the running container state:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-11-22-24598b39.jpg"
 
 
 loading="lazy"
 
 alt="Docker Support"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;However, when browsing to http://localhost:2500, nothing is showing up; also, the container is not providing any logs. Not even when running in interactive mode.&lt;/p&gt;
&lt;p&gt;From here, I started redoing a lot of steps, going through about all troubleshooting steps I could find online, starting all over from the application source code, going through the &lt;em&gt;Add&amp;hellip; Docker Support&lt;/em&gt; steps once more,&amp;hellip; always resulting in the same. A workable containerized application in Visual Studio debug mode, but not when starting the exact same container manually. Frustrating :)&lt;/p&gt;
&lt;h2 id="the-life-saver"&gt;The life saver
&lt;/h2&gt;&lt;p&gt;After trying, trying again, trying once more,&amp;hellip; I thought about &lt;em&gt;why not creating a Dockerfile manually and testing from there&lt;/em&gt;. GOOD THOUGH apparently.&lt;/p&gt;
&lt;p&gt;Here is the Dockerfile I came up with, after reading several Docker articles, blog posts and validating several of my other sample applications from earlier demo scenarios I used:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WORKDIR /app
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Copy *.sln .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;COPY . .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WORKDIR /app/src/SimplCommerce.WebHost
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RUN dotnet restore 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RUN dotnet publish -c Release -o out
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS runtime
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WORKDIR /app
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;COPY --from=build /app/src/SimplCommerce.WebHost/out ./
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ENTRYPOINT [&amp;#34;dotnet&amp;#34;, &amp;#34;SimplCommerce.WebHost.dll&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Technically, this Dockerfile is doing almost the exact same as what the Visual Studio generated one did, using the exact same base images (dotnet sdk and dotnet asp.net), as well as copying all the files, and using &amp;ldquo;dotnet SimplCommerce.Webhost.dll&amp;rdquo; as the starting command when the container starts up.&lt;/p&gt;
&lt;p&gt;Surprisingly, &lt;strong&gt;this seemed to work fine&lt;/strong&gt;! I could start my container on my local machine, but also push it into Azure Container Instance and run it fine, and even tried using it in my Azure Kubernetes cluster. And all was working fine.&lt;/p&gt;
&lt;h2 id="closing"&gt;Closing
&lt;/h2&gt;&lt;p&gt;I guess I need to go through the concepts and details of a Dockerfile much more in detail to figure out where the differences were, but at least for now, I can move on with building my next demo scenario. Automating all this using &lt;strong&gt;&lt;a class="link" href="https://dev.azure.com" target="_blank" rel="noopener"
 &gt;Azure DevOps Pipelines&lt;/a&gt;&lt;/strong&gt;. Which will be for a future blog post I promise&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2020-11-22-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See you all soon, reach out when you have any questions or comments on this post or on Azure in general,&lt;/p&gt;
&lt;p&gt;Cheers, Peter&lt;/p&gt;</description></item><item><title>Use Docker Edge to Deploy Azure Container Instance - ACI</title><link>https://www.pdtit.be/post/use_docker_edge_to_deploy_aci/</link><pubDate>Sun, 05 Jul 2020 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/use_docker_edge_to_deploy_aci/</guid><description>&lt;p&gt;Hey there,&lt;/p&gt;
&lt;p&gt;At the recent DockerCon (virtual) Conference, Docker announced a more tightened partnership with Microsoft, boosting the adoption and integration of Docker containers for Windows Server as well as Azure-running workloads. A first announcement involved a cool integration with Azure Container Instance (ACI), a low-level container runtime on Azure, allowing you to run a container without the typical complexity. While ACI has been around for 2 or more years already, it &lt;strong&gt;now becomes possible to manage and run your ACI-based containers directly from the Docker commandline&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;And that&amp;rsquo;s exactly what I will guide you through in this post.&lt;/p&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;This capability is in preview for now, and requiring &lt;strong&gt;Docker Desktop Edge 2.3.2&lt;/strong&gt; (I&amp;rsquo;ll show you how to upgrade if you already Run Docker)&lt;/li&gt;
&lt;li&gt;An Azure subscription, allowing you to deploy and run Azure Container Instance&lt;/li&gt;
&lt;li&gt;A sample Docker container (you can grab &lt;a class="link" href="https://hub.docker.com/r/pdetender/simplcommerce/" target="_blank" rel="noopener"
 &gt;my example&lt;/a&gt; if you want, or use any other you like)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="upgrading-to-edge-desktop"&gt;Upgrading to Edge Desktop
&lt;/h2&gt;&lt;p&gt;I was already running Docker Desktop on my Windows 10 machine, using Windows Subsystem for Linux (WSL) integration; I actually wrote &lt;a class="link" href="https://www.pdtit.be/post/migrate-docker-desktop-to-wsl2/" &gt;another post&lt;/a&gt; on this a few weeks ago, on how to get this up and running.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From the Docker icon in the taskbar, select &amp;ldquo;About Docker Desktop&amp;rdquo;; this will show you the current version&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-13bd02ab.jpg"
 
 
 loading="lazy"
 
 alt="Current Docker Desktop"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;As you can see, I&amp;rsquo;m using the &lt;strong&gt;stable&lt;/strong&gt; version 2.3.0.3&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Since I keep my demo containers in Docker Hub, I wasn&amp;rsquo;t too worried about losing them. However, if you want to keep a backup of your current Docker images, know you can store these in a Linux-tar file, using&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker save -o &amp;lt;nameforbackup.tar&amp;gt; &amp;lt;docker_image_name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-a4ae067e.jpg"
 
 
 loading="lazy"
 
 alt="Save Docker Image"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Uninstall Docker Desktop, by searching for &amp;ldquo;Docker Desktop&amp;rdquo; in the Start Menu, right-click it and select &amp;ldquo;Uninstall&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-dddbf586.jpg"
 
 
 loading="lazy"
 
 alt="Uninstall Docker"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Follow the instructions to have the software removed from your machine.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-49b78163.jpg"
 
 
 loading="lazy"
 
 alt="Docker Removed"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;From the &lt;a class="link" href="http://www.docker.com" target="_blank" rel="noopener"
 &gt;Docker&lt;/a&gt; website, download the &lt;strong&gt;Docker Desktop Edge&lt;/strong&gt; edition&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-295efc5a.jpg"
 
 
 loading="lazy"
 
 alt="Select Docker Desktop Edge"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Accept the options to create a desktop shortcut and allow the integration with WSL (if that is what you were using before&amp;hellip;)&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-132f83ae.jpg"
 
 
 loading="lazy"
 
 alt="Install Settings"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Wait for the component install to complete&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-a697c06d.jpg"
 
 
 loading="lazy"
 
 alt="Install Complete"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;After only a few minutes, Docker Desktop should run again fine. You can validate this from the Docker icon in the taskbar&amp;rsquo;s notification area; if it shouldn&amp;rsquo;t start automatically, you can start it from here as well, by right-clicking on it. (FYI, I actually had to restart my machine before it actually ran fine, but I am on Windows 10 Insider Preview 19640, if that should matter at all :))&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-0c18658c.jpg"
 
 
 loading="lazy"
 
 alt="Docker Desktop Running"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;Confirm Docker Desktop Edge is running fine from a &lt;em&gt;Docker Perspective&lt;/em&gt; , by opening your Command Prompt, and running&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Docker info
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-b13c03cc.jpg"
 
 
 loading="lazy"
 
 alt="Docker Info"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Nice, that upgrade went smooth already!&lt;/p&gt;
&lt;p&gt;Before we move on to the next step, let&amp;rsquo;s restore our previously used Docker Image (if you created the backup), by running the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Docker&lt;/span&gt; &lt;span class="nb"&gt;load&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;name_of_the_backupimage&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="n"&gt;tar&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-87a776f0.jpg"
 
 
 loading="lazy"
 
 alt="Restore Docker Image"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;and validate by running&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker images
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-aee2cfa1.jpg"
 
 
 loading="lazy"
 
 alt="Restore Docker Image"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;On to the next step&amp;hellip; Now we are running the latest Docker Desktop Edge, it is time to play around with the newest Azure Container Instance (ACI) integration - which is the whole point of this blog post.&lt;/p&gt;
&lt;p&gt;In short, you go through the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Authenticate to Azure, directly from Docker&lt;/li&gt;
&lt;li&gt;connect Docker to Azure Container Instance by creating a &amp;ldquo;Docker Context&amp;rdquo; (think of this as an environment with its own settings, much like dev/test, staging, production. Or in our case, the &amp;ldquo;default context&amp;rdquo; being your local machine running Docker, and the other one being &amp;ldquo;Azure&amp;rdquo;)&lt;/li&gt;
&lt;li&gt;Allocate a Docker Hub image to run as an Azure Container Instance, and run it&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="authenticate-to-azure-directly-from-docker"&gt;Authenticate to Azure, directly from Docker
&lt;/h2&gt;&lt;p&gt;The first feature that is part of the Docker Desktop Edge, is allowing us to authenticate to Azure, directly from the Docker engine. Initiate the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Docker Login Azure
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-86961e5d.jpg"
 
 
 loading="lazy"
 
 alt="Authenticate to Azure"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;This will prompt you for your Azure subscription credentials in a browser, just like a regular Azure authentication prompt (this also recognizes MFA, to make this a rather secure option)&lt;/p&gt;
&lt;h2 id="creating-a-docker-context"&gt;Creating a Docker Context
&lt;/h2&gt;&lt;p&gt;From your Command Prompt, create a new &lt;strong&gt;Docker Context&lt;/strong&gt;, by running the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker context create aci &amp;lt;name_for_the_context&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Based on the authenticated logon from the previous step, it will list up the different Azure subscriptions linked to your account; using the &amp;ldquo;arrow&amp;rdquo; keys, you can select the subscription you want to use. Next, it will list up the different Resource Group within your subscription.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-fb1e808b.jpg"
 
 
 loading="lazy"
 
 alt="Create ACI Context"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;rsquo;t want to use an existing Resource Group, you can create a new one:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-43872c02.jpg"
 
 
 loading="lazy"
 
 alt="Create ACI Context new RG"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;While this works, the naming convention for the newly created Resource Group is probably not going to work in any organization (naming convention policies etc&amp;hellip;); so let&amp;rsquo;s run this command again, and create a new context, based on an already existing Resource Group we want to use, by running the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker context create aci &amp;lt;name_for_the_context&amp;gt; --location &amp;lt;azure_region_name&amp;gt; --resource-group &amp;lt;name_of_the_Azure_RG&amp;gt; --subscription &amp;lt;name_of_the_Azure_subscription&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-51aaf964.jpg"
 
 
 loading="lazy"
 
 alt="Create ACI Context existing RG"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;The Docker Context, pointing to Azure ACI is available now. Let&amp;rsquo;s continue with running an actual container in the next step.&lt;/p&gt;
&lt;h2 id="running-your-aci-using-a-docker-hub-image"&gt;Running your ACI using a Docker Hub image
&lt;/h2&gt;&lt;p&gt;Running a Docker container within the ACI instance, is based on the exact same Docker command you would use if it was running on your local machine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker run -d -p &amp;lt;portmapping&amp;gt; &amp;lt;name_of_the_container_image&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;which looks like this for my example:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-9392b6d3.jpg"
 
 
 loading="lazy"
 
 alt="Docker run container"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;where&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;80:80&lt;/strong&gt; tells the container to run the workload on port 80, and expose it to the outside world on port 80 as well&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pdetender/simplcommerce&lt;/strong&gt; points to an e-commerce application container I have available in my Docker Hub repository&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At first, a new unique name for the Docker container runtime will get created (the &amp;ldquo;trusting-cartright&amp;rdquo;) in my example, followed by the deployment of a new Azure Container Instance&lt;/p&gt;
&lt;p&gt;In less than a minute, the job is completed successfully. Time to validate the running container. This - again - is identical to validating your running Docker container instances on your local machine:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker ps
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-841512b2.jpg"
 
 
 loading="lazy"
 
 alt="ACI is running"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;which shows you the running container instance, as well as the necessary details about the public-IP address of the instance. From your browser, connect to this public IP address, and see our sample workload in action:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-7136e153.jpg"
 
 
 loading="lazy"
 
 alt="ACI validate in browser"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;You can also validate this from the Azure Portal, by connecting to the Azure Container Instance (this could also be done from Azure CLI or Azure PowerShell to be complete&amp;hellip;)&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-c95290a1.jpg"
 
 
 loading="lazy"
 
 alt="ACI validate in portal"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Wonderful! This new Docker Edge integration with ACI is a nice improvement, and saving several steps from the &amp;ldquo;old way&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This completes the core of what I wanted to discuss in this post, showing you the nice capabilities from Docker Desktop Edge, to natively deploy and run an Azure Container Instance.&lt;/p&gt;
&lt;h2 id="running-your-aci-using-an-azure-container-registry-acr-image"&gt;Running your ACI using an Azure Container Registry (ACR) image
&lt;/h2&gt;&lt;p&gt;&amp;lt;these steps are not required anymore as part of the process, but just wanted to do some additional testing :)&amp;gt;&lt;/p&gt;
&lt;p&gt;The previous example was using a public Docker Hub container image. So I was wondering if this would also work for a (private) Docker image I already have in my Azure Container Registry. Let&amp;rsquo;s give it a try:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;create a new Docker Context for ACI&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-4ae87fbd.jpg"
 
 
 loading="lazy"
 
 alt="ACI context creation"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Run the Docker Container, pointing to the Azure Container Registry image&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-613755a4.jpg"
 
 
 loading="lazy"
 
 alt="run ACR image"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Hmm, that&amp;rsquo;s an interesting error message&amp;hellip; something &amp;ldquo;gcloud&amp;rdquo; related (=Google Cloud Platform :)). After some searching on the interwebs, it seems like my Docker instance is having some default authentication providers in its config.json file&amp;hellip; interesting&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-406a84ee.jpg"
 
 
 loading="lazy"
 
 alt="config.json"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Apparently it is safe to remove the section &amp;ldquo;CredHelpers&amp;rdquo;, saving the file and running the &amp;ldquo;Docker Run&amp;rdquo; again:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-96004182.jpg"
 
 
 loading="lazy"
 
 alt="run ACR image"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;While that weird gcloud error is gone, we are not quite there yet. But this error makes more sense to me. What it says here, is that the Docker Context cannot connect to the Azure Container Registry. Of course not, I need to authenticate to ACR first (&lt;strong&gt;az acr login&lt;/strong&gt;), just like when I am running this locally on my machine:&lt;/p&gt;
&lt;p&gt;where -g refers to the name of the Resource Group having the Azure Container Registry, and -n refers to the name of the Azure Container Registry itself&lt;/p&gt;
&lt;p&gt;which works much better now; similar to the first example, a new Azure Container Instance is getting deployed:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-b1bde042.jpg"
 
 
 loading="lazy"
 
 alt="az acr login"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s validate once more by initiating &amp;ldquo;docker ps&amp;rdquo;, which shows the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-2a31c07b.jpg"
 
 
 loading="lazy"
 
 alt="docker ps"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;and checking from the browser, if the workload is actually showing what it needs to show (note it is the same workload, just a different product category):&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-8c54c033.jpg"
 
 
 loading="lazy"
 
 alt="workload runs"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;and lastly, checking back on what it looks like from the Azure Portal&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-07-05-84f98824.jpg"
 
 
 loading="lazy"
 
 alt="ACI running in portal"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;I love this!!&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;In this post, I introduced you to a brand new capability from Docker Desktop Edge, providing a direct (native almost) integration with Azure Container Instance. This allows you to deploy and run a container instance on Azure, without much hassle. I showed you how this works with public Docker Hub images, as well as with more private images from an Azure Container Registry.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2020-07-05-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>How to delete a POD from Azure Kubernetes Services (AKS)</title><link>https://www.pdtit.be/post/how-to-delete-an-aks-pod/</link><pubDate>Sat, 06 Jun 2020 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/how-to-delete-an-aks-pod/</guid><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;In about every Azure training delivered the last few months, I am talking about &lt;a class="link" href="http://www.docker.com" target="_blank" rel="noopener"
 &gt;Docker&lt;/a&gt; and &lt;a class="link" href="https://azure.microsoft.com/en-us/services/kubernetes-service/" target="_blank" rel="noopener"
 &gt;Azure Kubernetes Services - AKS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Along these months, the amount of &amp;ldquo;sample PODS&amp;rdquo; I am running within the Kubernetes cluster was continuously growing, resulting in a less efficient demo scenario to show.&lt;/p&gt;
&lt;p&gt;So cleaning up these running PODS was my 5 seconds action this Saturday morning. While not super hard, it actually took me a bit longer than 5 seconds (more like 10min :)), since I forgot a few &amp;ldquo;basics&amp;rdquo; on how Kubernetes is running PODS.&lt;/p&gt;
&lt;p&gt;To safe myself some time in the future, and even more, helping readers from making the same mistake, I took note of it:&lt;/p&gt;
&lt;h2 id="the-before-situation"&gt;The Before Situation
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I am not discussing how to deploy AKS on Azure, there is already enough documented on how to achieve this using the &lt;a class="link" href="https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal" target="_blank" rel="noopener"
 &gt;Azure Portal&lt;/a&gt; as well as using &lt;a class="link" href="https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough" target="_blank" rel="noopener"
 &gt;Azure CLI&lt;/a&gt; to do this.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Deploying PODS (=your Docker containerized application) to the Kubernetes cluster is done using a &amp;ldquo;Kubernetes.YAML&amp;rdquo; file, having settings on the application name, the amount of container replicas you want to run within the cluster for high availability, and the link to the Azure Container Registry where the container image can be found.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A sample such kubernetes.yml looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-084e3b77.jpg"
 
 
 loading="lazy"
 
 alt="Sample Kubernetes.yml"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Some important settings in this file are:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;metadata / name&lt;/strong&gt; this is the name of the deployment (important for later&amp;hellip;!) (agderkubdemo in my example)
&lt;strong&gt;template / app&lt;/strong&gt; this is the name of the application within the AKS cluster (agderkubdemo in my example)
&lt;strong&gt;containers / name&lt;/strong&gt; name of the Azure (or other or Public Docker Hub) Container Registry
&lt;strong&gt;containers / image&lt;/strong&gt; name of the Azure (or other or Public Docker hub Container Repository (=name of your Docker container image))&lt;/p&gt;
&lt;p&gt;Once you have this file, you can run the following command to get the PODS deployed to your AKS cluster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl apply -f &amp;lt;path to the kubernetes.yml file&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;So that&amp;rsquo;s what I currently had, a running AKS server with a couple of tens of these sample app containers running :)&lt;/p&gt;
&lt;h2 id="how-to-delete-pods-from-aks"&gt;How to delete PODS from AKS
&lt;/h2&gt;&lt;p&gt;If you want to know what PODS you are actually running on your AKS cluster, run the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get pods
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;which looks similar to what I have in my environment:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-5cf632e7.jpg"
 
 
 loading="lazy"
 
 alt="kubectl get pods"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Easy enough, there is a &lt;strong&gt;kubectl&lt;/strong&gt; command to delete PODS, go figure:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl delete PODS &amp;lt;name of the POD&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;which nicely deletes the identified POD&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-acf5e570.jpg"
 
 
 loading="lazy"
 
 alt="kubectl delete pods"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;or did it?&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-9be32917.jpg"
 
 
 loading="lazy"
 
 alt="kubectl get pods again"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Apparently the PODS were not really getting deleted in the way I wanted them to be completely removed from the cluster. My &amp;ldquo;active&amp;rdquo; PODS turned to a state &amp;ldquo;terminating&amp;rdquo;, but at the same time, there were &lt;strong&gt;2 new PODS&lt;/strong&gt; running the same application. What&amp;rsquo;s going on?&lt;/p&gt;
&lt;p&gt;After a few seconds, it struck me what AKS was doing here&amp;hellip; The built-in high availability of Kubernetes always tries to make sure it has container instances running, according to&amp;hellip; what you defined in your &lt;strong&gt;deployment&lt;/strong&gt; (=the kubernetes.yml file).&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s check that file again:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-084e3b77.jpg"
 
 
 loading="lazy"
 
 alt="Sample Kubernetes.yml"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;I had my &lt;strong&gt;specs / replicas&lt;/strong&gt; set to &amp;ldquo;3&amp;rdquo;, which means Kubernetes runs 3 identical container instances of my application (for high availability). So in reality, when you run the &lt;strong&gt;delete&lt;/strong&gt; action against a replica, AKS just starts up new instances, to comply to the 3 running instances you ask for.&lt;/p&gt;
&lt;p&gt;So there must be another way to run the deletion.&lt;/p&gt;
&lt;p&gt;One source I found on the internet recommended to set the &lt;strong&gt;replica&lt;/strong&gt; parameter to &amp;ldquo;0&amp;rdquo;, but that felt a bit weird to me (although I actually tried and succeeded).&lt;/p&gt;
&lt;p&gt;However, the best practice seems to be deleting the actual &lt;strong&gt;deployment&lt;/strong&gt;. Remember I pointed this out earlier, this setting is in the &amp;ldquo;kubernetes.yml&amp;rdquo; file as well, saying this setting was &lt;strong&gt;important&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;metadata / name&lt;/strong&gt; this is the name of the deployment (important for later&amp;hellip;!) (agderkubdemo in my example)&lt;/p&gt;
&lt;p&gt;Within Kubernetes, when you run a &amp;ldquo;kubectl apply&amp;rdquo; action, it &lt;em&gt;remembers&lt;/em&gt; this state as a deployment. So by removing this deployment, it will also remove the corresponding PODS. Let&amp;rsquo;s give that a try:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl delete deployment &amp;lt;deployment name&amp;gt; (=from the metadata / name setting in the YML file...)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Or you could also use parameter &amp;ldquo;&amp;ndash;all&amp;rdquo; as follows, to delete all previous deployments at once:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl delete deployment --all
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-8dab53b2.jpg"
 
 
 loading="lazy"
 
 alt="kubectl delete deployment"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;If we know check what happens with the running PODS, they will all be nicely terminated, and eventually getting deleted from the AKS environment:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kubectl get pods
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-06-06-5eb66e9a.jpg"
 
 
 loading="lazy"
 
 alt="kubectl delete deployment"
 
 
 
 &gt;&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;This post described how you can successfully delete running PODS from an AKS environment, using different scenarios.&lt;/p&gt;
&lt;p&gt;See you all soon, reach out when you have any questions on AKS or Azure in general,&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2020-06-06-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers, Peter&lt;/p&gt;</description></item><item><title>Migrating Docker Desktop to WSL2</title><link>https://www.pdtit.be/post/migrate-docker-desktop-to-wsl2/</link><pubDate>Sat, 30 May 2020 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/migrate-docker-desktop-to-wsl2/</guid><description>&lt;p&gt;Hey there,&lt;/p&gt;
&lt;p&gt;With the May update of Windows 10 (named Windows 2004 :) ) being available since this week, together with DockerCon virtual conference, I think it was the right time to (finally) migrate my current Docker Desktop in Hyper-V mode to the new WSL 2 (Windows Subsystem for Linux).&lt;/p&gt;
&lt;p&gt;In short, the process was smooth, straight forward, and not having any real impact on my &amp;ldquo;demo environment&amp;rdquo; I&amp;rsquo;m using continuously during my Azure training workshops and public speaking gigs.&lt;/p&gt;
&lt;p&gt;This also only took about 20min of my time, including writing this blog post. LOL.&lt;/p&gt;
&lt;p&gt;Here we go:&lt;/p&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;The main prerequisite I want to highlight here is you need the May 2020 update for your Windows 10 machine; If you don&amp;rsquo;t have it yet, here is a quick how-to-install the May 2020 Update:&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Settings / Update &amp;amp; Security / Windows Update&lt;/strong&gt;. Here, select &lt;strong&gt;&amp;ldquo;Check for updates&amp;rdquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once the update is listed, select &lt;strong&gt;Download and install&lt;/strong&gt;. (If you don&amp;rsquo;t see the notification to download and install, the update may not have been published yet for your machine/region, but you should receive it any time soon. I mean it&amp;rsquo;s the May update :) (actually was the April update, but due to COVID19 got pushed out a bit). Also make sure you currently are running &lt;strong&gt;Windows 10 version 1903 or version 1909&lt;/strong&gt;.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once the download is finished and ready to install, you&amp;rsquo;ll get a notification to choose the right time to finish the installation and reboot your computer. I actually ran this automated over night, and it welcomed me this morning.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Why not required for my Docker and WSL 2 upgrade, I was suprised there is &lt;strong&gt;No Edge&lt;/strong&gt; browser included with this release, so that&amp;rsquo;s the first application I updated&amp;hellip;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="installing-wsl-2"&gt;Installing WSL 2
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;WSL (Windows Subsystem for Linux) was released almost 3 years ago, and got recently upgraded to v2, as part of the Windows 10 May update. It provides an almost full Linux distri (Ubuntu, openSUSE, Kali, Debian,&amp;hellip;). WSL 2 comes with incredible performance improvements, nicer integration for mixed Windows/Linux platform developers (did somebody say dotnet core?) and also provides Docker support. If you were running the WSL v1 already, you don&amp;rsquo;t have to do anything but will get a notification from within the WSL environment to upgrade to WSL 2.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wasn&amp;rsquo;t running WSL yet, so went through the following steps, per the Microsoft documentation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a &lt;strong&gt;PowerShell session as Administrator&lt;/strong&gt;, and run the following cmdlet to &lt;strong&gt;install the WSL feature&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-9c0a56b4.jpg"
 
 
 loading="lazy"
 
 alt="Install WSL Feature"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Next, &lt;strong&gt;install the Virtual Machine (Hypervisor) feature&lt;/strong&gt;, by running the following cmdlet:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-b40c9c87.jpg"
 
 
 loading="lazy"
 
 alt="Install VMPLatform Feature"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;&lt;strong&gt;Enable WSL 2&lt;/strong&gt; as default by running the following cmdlet:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wsl --set-default-version 2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-f72dff38.jpg"
 
 
 loading="lazy"
 
 alt="Set WSL2 as default"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;You can now &lt;strong&gt;install your Linux distri of choice&lt;/strong&gt;, by &lt;strong&gt;launching the Microsoft Store App&lt;/strong&gt; on your Windows 10 machine. I selected &lt;strong&gt;Ubuntu&lt;/strong&gt;, but know you have a few other ones available as well&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-2005e924.jpg"
 
 
 loading="lazy"
 
 alt="MS Store Ubuntu"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="5"&gt;
&lt;li&gt;&lt;strong&gt;Click Install&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-69b82c78.jpg"
 
 
 loading="lazy"
 
 alt="MS Store Ubuntu install"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="6"&gt;
&lt;li&gt;&lt;strong&gt;Wait&lt;/strong&gt; for the install to complete, and &lt;strong&gt;press launch&lt;/strong&gt; to start the Ubuntu environment&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-b1dc0fdf.jpg"
 
 
 loading="lazy"
 
 alt="Launch Ubuntu"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="7"&gt;
&lt;li&gt;Give it a few minutes to finalize the Ubuntu installation within the WSL environment. You are also prompted for a Linux local administrative username and password (this can - and SHOULD - be different from your Windows local admin account credentials for security reasons&amp;hellip;!)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-deb4e528.jpg"
 
 
 loading="lazy"
 
 alt="Configure Ubuntu"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="8"&gt;
&lt;li&gt;After a few moments, your Ubuntu environment is up-and-running. Again, this replaces any former Ubuntu virtual machine you had running on Hyper-V, Virtualbox, VMware Player,&amp;hellip; on the same Windows 10 machine of yours.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-ef8500a0.jpg"
 
 
 loading="lazy"
 
 alt="Ubuntu ready"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;Keep in mind you cannot install any &amp;ldquo;GUI&amp;rdquo; applications inside the WSL environment, but can use any commandline-based application. It&amp;rsquo;s a full Linux distri remember!!&lt;/p&gt;
&lt;h2 id="switching-docker-to-wsl-2"&gt;Switching Docker to WSL 2
&lt;/h2&gt;&lt;p&gt;My setup here involved a &amp;ldquo;migration&amp;rdquo; from Docker using it&amp;rsquo;s own Moby Hyper-V VM to WSL 2; this means I&amp;rsquo;m losing the current Linux containers I already use within my Docker environment. If you want to reuse them within the WSL environment, &lt;strong&gt;make sure you get a list of them before switching the Docker mode&lt;/strong&gt;, by running the following cmdlet (PowerShell or CMD Prompt):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;docker images
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;which provides you an overview of the (Linux) Docker images you currently have on your machine&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-fe0576d7.jpg"
 
 
 loading="lazy"
 
 alt="Docker images"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;I only have a few left, since I did a nice cleanup before (docker rmi &lt;image name&gt;)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From the &lt;strong&gt;Docker Desktop&lt;/strong&gt; context menu / Settings / enable the &lt;strong&gt;&amp;ldquo;Use the WSL 2 based engine&amp;rdquo;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-e260fbee.jpg"
 
 
 loading="lazy"
 
 alt="Switch Docker to WSL2"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;While not really needed, it&amp;rsquo;s always nice to &lt;strong&gt;validate&lt;/strong&gt; this is actually working fine; the first check I did is executing a &lt;strong&gt;&amp;ldquo;Docker info&amp;rdquo;&lt;/strong&gt; command, which shows the running state of the Docker engine, while at the same time validating the former Docker Moby VM is down - obviousy this was the case:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-74d15289.jpg"
 
 
 loading="lazy"
 
 alt="Docker info"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;We can now download and run our former Docker images again, to have the same setup as before; on my machine, I had a few images available, like &amp;ldquo;Ubuntu&amp;rdquo;, &amp;ldquo;SimplCommerce&amp;rdquo; (an e-commerce app I use in workload demos,&amp;hellip;); let&amp;rsquo;s grab these by executing a &lt;strong&gt;&amp;ldquo;Docker run &lt;container image&gt;&amp;rdquo;&lt;/strong&gt; command:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;for my pdetender/simplcommerce (on Docker Hub) &lt;img src="../images/screenshot-2020-05-30-74d15289.jpg"
 
 
 loading="lazy"
 
 alt="Docker run container"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-5711f6c3.jpg"
 
 
 loading="lazy"
 
 alt="Docker run container"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;for a sample Ubuntu container; awesome! it works!&lt;/p&gt;
&lt;h2 id="updating-or-installing-visual-studio-code---docker-extension"&gt;Updating (or installing) Visual Studio Code - Docker Extension
&lt;/h2&gt;&lt;p&gt;Managing Docker is all commandline based, and it&amp;rsquo;s not always that convenient to remember all commands during live demos. And even during day-to-day operations, I tend to make my life a bit easier, if there is a GUI available for &amp;ldquo;easy tasks&amp;rdquo;. That&amp;rsquo;s where VSCode extensions are powerful. Including the &lt;strong&gt;Docker&lt;/strong&gt; one; if you haven&amp;rsquo;t installed it yet, please do so :).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right after my upgrade to WSL 2 above, it got picked up by VSCode immediately, showing me the following notification:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-27124db9.jpg"
 
 
 loading="lazy"
 
 alt="VSCode WSL notification"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;which I obviously installed, ending up in (yet another) extension:&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-f9c3a0ee.jpg"
 
 
 loading="lazy"
 
 alt="VSCode extension"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Next, I validated my version of the Docker extension, if it was updated to the latest one (if you installed this extension already, it typically runs a silent update by itself&amp;hellip;)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-819a2a60.jpg"
 
 
 loading="lazy"
 
 alt="VSCode Docker extension"
 
 
 
 &gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Which allows us to manage our Docker environment from the VSCode GUI now:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-05-30-40795e92.jpg"
 
 
 loading="lazy"
 
 alt="VSCode Docker GUI"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;and guaranteeing again for some nice upcoming demos during my Azure workshops!&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;In today&amp;rsquo;s post, I walked you through an upgrade (or installation&amp;hellip;) of a Docker Desktop on Windows 10 from the Moby VM Hyper-V setup to the latest WSL 2, thanks to an upgrade in Windows 10 May 2020 update build. While I only did a few quick functional tests, making sure my environment is still running as before, I have a slight feeling this WSL 2 is going to be used much more, and not just for my Docker integration.&lt;/p&gt;
&lt;p&gt;Ping me if you got any questions!&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.buymeacoffee.com/pdtit" target="_blank" rel="noopener"
 &gt;&lt;img src="../images/screenshot-2020-05-30-17f576e7.png"
 
 
 loading="lazy"
 
 alt="BuyMeACoffee"
 
 
 
 &gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;/Peter&lt;/p&gt;</description></item><item><title>Happy to announce my newest Azure book got (self) published</title><link>https://www.pdtit.be/post/new-azure-book-selfpublish/</link><pubDate>Fri, 03 Jan 2020 00:00:00 +0000</pubDate><guid>https://www.pdtit.be/post/new-azure-book-selfpublish/</guid><description>&lt;p&gt;I&amp;rsquo;m excited about this next project that finally got live, thanks to a bit of quiet time during the Holidays. While it is not up to the full 100% of what I had in mind, I didn&amp;rsquo;t want to hold back the content any longer, since Azure is moving already that fast&amp;hellip;&lt;/p&gt;
&lt;p&gt;The original idea of this material was based on a workshop I created for Microsoft Internal (Azure Developer Series) in Sept 2018 as a contractor, which was a combination of slides, videos and lab guides. The workshop existed in both in-person and virtual delivery format. At that time, the sample application was rather basic. Early July 2019, I got asked to work on an update of the content, and extend it with Azure DevOps, which was well-adopted in the market already, but still unknown to a lot. Instead of just working on “updates”, I decided to start from scratch, and work towards a more “business ready” application, using &lt;strong&gt;&lt;a class="link" href="http://www.simplcommerce.com" target="_blank" rel="noopener"
 &gt;SimplCommerce&lt;/a&gt;&lt;/strong&gt;, an Open Sourced E-commerce platform application, built in .NET / .NET Core, and supporting different database back-ends.&lt;/p&gt;
&lt;p&gt;Flipping the presentations and lab guides into a book seemed like an interesting idea at that time.&lt;/p&gt;
&lt;p&gt;Talking to several people about this, it became clear that – given the focus on the technical side of the Azure platform, together with the focus on the hands-on aspect of the workshop, most vouched for a hands-on guide, and leaving the ‘speaker notes’ behind. Next, me moving to Microsoft as a full-time employee mid September 2019, was another good reason to shorten the format of this book. It would still take me another 3 months (Christmas Holidays aka slower pace&amp;hellip;) to go through all labs again myself, guaranteeing the book was ready for usage, even without having a trainer available to ask questions.&lt;/p&gt;
&lt;p&gt;This is the first book I’m doing in self-publishing, and my 6th book overall (see /publications) for more details on the other material I wrote along the years.&lt;/p&gt;
&lt;p&gt;The benefit for you as a reader is that you will get continuous updates. Whether these are bug-fixes, additional chapters/lab steps or major updates to existing labs, you will get notified about it. The advantage for me as the author, is that it is probably one of the best ways to publish content on a topic that is as fast moving as Azure.&lt;/p&gt;
&lt;p&gt;&lt;img src="../images/screenshot-2020-01-03-f51c8ea1.png"
 
 
 loading="lazy"
 
 alt="Cover_Efficiently_Migrating_to_Azure"
 
 
 
 &gt;&lt;/p&gt;
&lt;p&gt;As always, I hope this book maps with your interests and helps in your journey to Azure. Do not hesitate reaching out or sharing your feedback,&lt;/p&gt;
&lt;p&gt;Here is some more info about the actual book contents:&lt;/p&gt;
&lt;h2 id="hands-on-lab-scenario"&gt;Hands-On-Lab Scenario
&lt;/h2&gt;&lt;p&gt;You are part of an organization that is running a dotnetcore e-commerce platform application, using Windows Server infrastructure on-premises today, comprising a WebVM running Windows Server 2012 R2 with Internet Information Server (IIS) and a 2nd SQLVM running Windows Server 2012 R2 and SQL Server 2014.&lt;/p&gt;
&lt;p&gt;The business has approved a migration of this business-critical workload to Azure, and you are nominated as the cloud solution architect for this project. No decision has been made yet on what the final architecture should or will look like. Your first task is building a Proof-of-Concept in your Azure environment, to test out the different architectures possible:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Infrastructure as a Service (IAAS)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Platform as a Service (PAAS)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Containers as a Service (CaaS)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the same time, your CIO wants to make use of this project to switch from a more traditional mode of operations, with barriers between IT sysadmin teams and Developer teams, to a DevOps way of working. Therefore, you are tasked to explore Azure DevOps and determine where CI/CD Pipelines can assist in optimizing the deployment and running operations of this e-commerce platform, especially when deploying updates to the application.&lt;/p&gt;
&lt;p&gt;As you are new to the continuous changes in Azure, you want to make sure this process goes as smooth as possible, starting from the assessment to migration to day-to-day operations.&lt;/p&gt;
&lt;h2 id="abstract-and-learning-objectives"&gt;Abstract and Learning Objectives
&lt;/h2&gt;&lt;p&gt;This workshop enables anyone to learn, understand and build a Proof of Concept, in performing a multi-tiered .Net Core web application (SimplCommerce Open Source &lt;a class="link" href="http://www.simplcommerce.com" target="_blank" rel="noopener"
 &gt;http://www.simplcommerce.com&lt;/a&gt;) using Microsoft SQL Server database, platform migration to Azure public cloud, leveraging on different Azure Infrastructure as a Service, Azure Platform as a Service (PaaS) and Azure Container offerings like Azure Container Instance (ACI) and Azure Kubernetes Services (AKS).&lt;/p&gt;
&lt;p&gt;Immediately in lab 1, students get introduced to the basics of automating Azure resources deployments using Visual Studio and Azure Resource Manager (ARM) templates. Next, readers learn about the importance of performing proper assessments, and what tools Microsoft offers to help in this migration preparation phase. Once the application has been deployed on Azure Virtual Machines, students learn about Microsoft SQL database migration to SQL Azure PaaS, as well as deploying and migrating web applications to Azure Web Apps.&lt;/p&gt;
&lt;p&gt;After these foundational platform components, the next exercises will totally focus on the core concepts and advantages of using containers for running business workloads, based on Docker, Azure Container Registry (ACR), Azure Container Instance (ACI) and WebApps for Containers, as well as how to enable container orchestration and cloud-scale using Azure Kubernetes Service (AKS).&lt;/p&gt;
&lt;p&gt;In the last part of the workshop, readers get introduced to Azure DevOps, the new Microsoft Application Lifecycle environment, helping in building a CI/CD Pipeline to publish workloads using the DevOps principals and concepts, showing the integration with the rest of the already touched on Azure services like Azure Web Apps and Azure Kubernetes Services (AKS), closing the workshop with a module on overall Azure monitoring and operations and what tools Azure has available to assist your IT teams in this challenge.&lt;/p&gt;
&lt;p&gt;The focus of the material is having a Hands-On-only Lab experience, by going through the following exercises and tasks:&lt;/p&gt;
&lt;p&gt;· Deploying a 2-tier Azure Virtual Machine (Webserver and SQL database Server) using ARM-template automation with Visual Studio 2019;&lt;/p&gt;
&lt;p&gt;· Publishing a .NET Core e-commerce application to an Azure Web Virtual Machine and SQL DB Virtual Machine;&lt;/p&gt;
&lt;p&gt;· Performing a proper assessment of the as-is Web and SQL infrastructure using Microsoft Assessment Tools;&lt;/p&gt;
&lt;p&gt;· Migrating a SQL 2014 database to Azure SQL PaaS (Lift &amp;amp; Shift);&lt;/p&gt;
&lt;p&gt;· Migrating a .NET Core web application to Azure Web Apps (Lift &amp;amp; Shift);&lt;/p&gt;
&lt;p&gt;· Containerizing a .NET Core web application using Docker, and pushing to Azure Container Registry (ACR);&lt;/p&gt;
&lt;p&gt;· Running Azure Container Instance (ACI) and WebApp for Containers;&lt;/p&gt;
&lt;p&gt;· Deploy and run Azure Azure Kubernetes Services (AKS);&lt;/p&gt;
&lt;p&gt;· Deploying Azure DevOps and building a CI/CD Pipeline for the subject e-commerce application;&lt;/p&gt;
&lt;p&gt;· Managing and Monitoring Azure Kubernetes Services (AKS);&lt;/p&gt;
&lt;h2 id="at-last"&gt;At last&amp;hellip;,
&lt;/h2&gt;&lt;p&gt;I also want to thank Amita Thukral, a far-away friend from India, with whom I had the pleasure to work along the years when doing Azure virtual workshop deliveries, where she was moderating the questions from the audience, and overall a very nice and professional person to work with. She did a tremendous job in screening the scenario, going through all lab steps, to make sure it all made sense. Even for less Azure-experienced folks.&lt;/p&gt;
&lt;p&gt;If this got your attention, head over to &lt;a class="link" href="http://www.leanpub.com" target="_blank" rel="noopener"
 &gt;Leanpub&lt;/a&gt;, and grab yourself a copy of the book. And start learning Azure :).&lt;/p&gt;
&lt;p&gt;Looking forward to your feedback,&lt;/p&gt;
&lt;p&gt;best regards, Peter
/Peter&lt;/p&gt;</description></item></channel></rss>