Bicep's syntax is already pretty clean, but sometimes you run into situations like needing to concatenate strings or format names repeatedly, doing small calculations based on input parameters, or having long, messy expressions inside resource definitions. Let’s say you want to automatically generate a series of VM names like web-01, web-02, and so on. Without functions, you’d have to write 'web-${padLeft(string(i+1), 2, '0')}' every time, makes you work 996. Let’s see how to make this easier.
I am using highlight.js to render code snippets on this blog system. However, the official pack of highlight.js does not have Bicep as one of the languages. To add support for the Bicep language in highlight.js, you need to implement a Bicep language definition module. Below are the detailed steps and code examples.
Last week at Microsoft Reactor Shanghai, I addressed a speech "Automating Infrastructure as Code (IaC) Deployment with Azure Bicep". One of the demo was how to use Bicep to deploy a complete Azure web app environment, including an App Service and an Azure SQL Database. I know we didn’t have time to walk through the whole script, so I wanted to break it down here in a blog post. Let’s walk through this Bicep file together, and see what each part does!
In Azure, Resource Groups are a key concept for managing resources. They provide a logical way to group related resources, making it easier to manage and control access. However, as your cloud environment git bigger, organizing Resource Groups becomes more difficult. This blog post explains common practices for using Azure Resource Groups. These tips will help you manage and organize your resources more effectively! Key features of Resource Group are: Group related resources together for easier management. Deleting a resource group also deletes all resources inside it. Assign roles and permissions at the resource group level (IAM).
When preparing for interviews, you'll often come across optimization problems that test both your problem-solving skills and your ability to write efficient code. I have such an interesting programming interview question years ago. The Efficient Shipping problem. Let's break it down and analyze the solution. And to understand the flaws in the first version of my code and how we can improve it.
Microsoft introduced the new Outlook last year. Many users, including myself, are not fond of the new Outlook. In early 2025, I discovered that Microsoft plans to automatically install the new Outlook on new Windows 11 machines. Additionally, users will be forced to switch to the new Outlook after opening the classic Outlook app a few times. What’s even more frustrating is that even if you uninstall the new Outlook app, it will reappear after some time. In this blog post, I’ll share a method to disable this automatic upgrade behavior.
Manually extracting and summing prices embedded in file names for a large number of files is time-consuming and is easy to make errors. This blog post introduces a PowerShell script designed to automate this process efficiently. The script scans a specified directory, identifies file names containing prices using a regex pattern, extracts these values, and calculates their total, making it an ideal solution for tasks like invoice management.