
Chaminda's Blog
1,000 FOLLOWERS
Chaminda Chandrasekara is a Visual Studio ALM with TFS and VSTS.
Chaminda's Blog
1w ago
We have disucussed pod restart Grafana panel in AKS in the post "Pod Restart Counts Grafana Chart with Azure Monitor for AKS". We can create similar panel for container restarts using managed Grafana in Azure for AKS using Azure monitor.
Expected Outcome
Panel similar to below showing contianer restarts for a applications over time with a table showing last container(s) of application restarts, maximum restarts for each application.
We can use the query below to create the container restart counts panel in Grafana with Azure monitor.
KubePodInventory
// | where $__timeFilter(Time ..read more
Chaminda's Blog
2w ago
If your pods are often restarting it might indicate a problem you might have in your application deployed to AKS. For example, there was some significant number of restarts seen in .NET 3.1 applications deployed to AKS (reason found as .NET 3.1 issue which is supposedly fixed in .NET 5, so the approach to fix was to update the applications to .NET 6), which were only appearing in development and in staging envronments, while QA environment haven't shown a single restart. Threfore, it is important to monitor the restart counts in pods to identify issues you might not see in development or ..read more
Chaminda's Blog
2w ago
As discussed in the post "Run .NET Core 3.1 Application with Windows Server Core 2019 Docker Image" there could be situations you need to setup .NET Core 3.1 on Windows servercore docker image. However, you might have experienced below error running Windows container, when you setup tools such as .NET runtime by yourself using dockerfile.
Let's see one such example case and how it can be fixed with .NET Core runtime 3.1 installed on Windows servercore docker image.
Intially when the below code is used with mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc201 ..read more
Chaminda's Blog
2w ago
You would love to run your .NET applications as Linux containers instead of using Windows containers. However, there are situations that you have to run your .NET applications as Windows containers with servercore docker image due to your project having dependencies, such as a third party dll (could be even built by different department in your company) which demands your application to run on Windows servercore docker image. Worst case is sometimes your app is still on .NET 3.1 Core you do not have a servercore image for .NET Core 3.1. (For .NET 5,6,7,8 the Windows servercore ..read more
Chaminda's Blog
1M ago
We have discussed how to create a Grafana panel for view Horizontal Pod Autoscaler (HPA) desired pod counts in AKS (Azure Kubernetes Services) in the post "Horizontal Pod Autoscaler Desired Replica Count Grafana Chart with Azure Monitor for AKS". As desired count is changing in HPA for an app monitoring how the actual pod count is changing would be really useful insights. Let's look at steps required to implement Grafana chart for actual pod counts over time using Azure monitor fror AKS.
Expected Outcome
Panel similar to below showing pods for a given app showing running, terminating an ..read more
Chaminda's Blog
1M ago
Horizontal Pod Autoscaler (HPA) in Kubernetes manage the number of instances for each pod deployment based on the scale settings specified. Itw would be good insights to monitor the demand for scaling of each pod. as a prerequicite we need to setup monitoring AKS cluster with Managed Grafana in Azure with Azure Monitor and Log Analytics Workspace. Let's see how we can create a Grafana pannel to monitor the HPA behaviour over time.
The expected outcome is similar to below for a given deployment (pod HPA). Here max replicas setting shown in yellow line while green line sho ..read more
Chaminda's Blog
1M ago
AKS can be setup with automatic node scaling using VM scalesets in node pools. It will be useful to monitor how the nodes are scaling over time to have a good insights, in to the AKS cluster nodes behaviour, while applications deployed in the cluster getting heavy traffic. We can enable monitoring AKS cluster with Managed Grafana in Azure with Azure Monitor and Log Analytics Workspace. Let's look at query to setup node count over time panel in Managed Grafana in Azure using Azure Monitor.
The expected outcome is a panel similar to below. Showing each node pool scaling over t ..read more
Chaminda's Blog
1M ago
You might want to trigger a release from another release pipeline, specially if you are deploying to a multi tenant application environment. In such cases when you trigger a pipeline from another pipeline the variables you are setting dynamically cannot be a secret variable. If you set a variable that should be settable at release time as a secret, the release cannot be triggerd via the Azure DevOps REST API call, as it will throw an exception such as below.
The 'secret' property of
variables cannot be altered while creating a release.&n ..read more
Chaminda's Blog
1M ago
Bicep is really simple and easy to implement infrastructure as Code tool for Azure. However, there is a bit of an issue with subnet resource when we try to redeploy. Even without no changes Bicep is trying to delete and create subnet resources and cmplaining a subnet cannot be deleted, because the resources are using it. Let's try to understand the problem and a solution to fix the issue.
The Scenario
Let's take a simple scenario where we want to deploy below resources.
Resource Group
Virtual Network (vNet)
Subnet
Network Interface in the subnet
We can create a network.bicep as shown ..read more
Chaminda's Blog
1M ago
Deployment groups are used in Azure DevOps classic release pipelines to define groups of targets an application should be deployed. We may sometime need to create these deployment groups dyamically based on the stage we are running in release pipeline. Let's look at the sample PowerShell code to use for creating depployment group dynamically, using Azure DevOps REST API, and how to use it in a pipeline.
The PowerShell script below is capable of creating a deployment group if a deployment group is not existing with the same name.
$token = 'yourPAT'$User=""$base64AuthInfo = [Convert]::T ..read more