We have discussed "Setting Up Azure Workload Identity for Containers in Azure Kubernetes Services" previously. We can use Azure CLI to interact with Azure resources in a container which is using base docker image "mcr.microsoft.com/azure-cli:latest-amd64". Instead of using specific credential information directly in the Azure CLI script in the container, we can use the workload identity to do an az login in a container where workload identity is enabled. Let's look at how to do that in this post.
Saturday, 7 December 2024
Friday, 29 November 2024
Use Dynamic Block Conditionally in Terraform with a Nested Block
We have discussed usage of dynamic blocks conditionally in terraform in the post "Use Dynamic Block Conditionally in Terraform". Sometimes we need to use dynamic with nested blocks. In this post look at such an example of using dynamic block with network rules for Azure event hubs.
We are going to setup a nested dynamic block as shown below.
Saturday, 16 November 2024
Disable Soft Delete for Azure File Shares with Terraform
Azure file shares can be used as mounted persisted volume in AKS clusters to provide necessary storage to pods in AKS. Azure file shares are enabled with soft delete for files by default. However, when the pod mounted storage is used as temporary storage for processing, there is no need to keep the capability of soft deletion. Let's look at how we can disable soft delete for file share storage when deploying the file share with terraform.
Saturday, 9 November 2024
Resolving "ERROR: Account has previously been signed out of this application.. Status: Response_Status.Status_AccountUnusable" When Terraform Plan
While trying to execute terraform plan locally after an az login we sometimes envounter below error.
│ Error: populating Resource Provider cache: listing Resource Providers: loading results: authorizing request: running Azure CLI: exit status 1: ERROR: Account has previously been signed out of this application.. Status: Response_Status.Status_AccountUnusable, Error code: 0, Tag: 540940121
│ Please explicitly log in with:│ az login --scope https://management.azure.com/.default
│ with provider["registry.terraform.io/hashicorp/azurerm"],│ on main.tf line 17, in provider "azurerm":│ 17: provider "azurerm" {
Saturday, 2 November 2024
Use Dynamic Block Conditionally in Terraform
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in many scenarios. For example, when we create Azure Cosmos DB, if we want to have read regions only in production environment, but only have one region setup for dev and QA environments we can, leverage the capabilities in Dynamic block of terraform. Let's explore with an example.
Saturday, 26 October 2024
Copy Blob Between Azure Storage Accounts with C# Using DefaultAzureCredential
Copying a blob between Azure storage account without downloading the blob locally is realy simple with azcopy command. Now using Azure.Storage.Blobs we can copy blobs between Azure sotrages without downloading the blob locally, with C# code as well. Using DefaultAzureCredential for the copy operation is useful, when we use apps with managed identities, such as workload identity in AKS. Let's explore steps necessary to copy a blob from one storage account to another with C# console app.
How it works
When the example simple console app is executed it copies blob from sourse storage account to target storage account as shown below.
Saturday, 19 October 2024
Cleanup Strategy for Azure Container Registry Based on Azure Pipeline Retained Builds
We generally use Azue container registry to store our application docker images when we use AKS as the ochestrator for our applications. However, piling up of previous releases images, as well as images used for developer teting in Azure container registry increase costs. Therefore it is important to have a periodic cleanup mechanism setup to remove all unused images form the registry. Let's look at a strategy we can use to cleanup Azure container registry.
Saturday, 12 October 2024
Deploying Azure Managed Grafana with Terraform
Grafana can be used to setup monitoring and alerting with AKS. Azure provide an option to setup managed grafana dashboard, which can be integrated with managed protheus for AKS. In this post let's explore terraform code to setup managed grafana instance similar to below.
Popular Posts
-
Let’s look at how we can specify the artifact version to download based on the resource CI build linked to the CD pipeline and check on how ...
-
The hosts file in /etc/hosts is allowing the WSL distros to map IP addresses to domain names before going to domain name servers, similar...
-
Can a Coded UI test executed with a Console Application? Yes it is possible. I am going to explain how it can be done. I am going to exec...
-
Pull Request are the controlled way to bring in the changes to your stable branches in your Azure Git repos, or for that matter all Git prov...
-
The new Azure Managed Redis can be deployed with balanced compute and memory with high availability, and useful modules such as RedisJson a...