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 deploying Azure OpenAI resources, prioritizing security is essential. One critical step is to restrict access to your API endpoint, ensuring only your applications can connect. By implementing such measures, even if your API key is leaked, unauthorized users will be unable to exploit it—protecting you from unexpected charges. Follow the steps outlined in this blog post to implement network restrictions and safeguard your resources.
Moonglade.Email, is an Azure Function that originally relied on SMTP for sending emails. Microsoft implemented a change that prevents connections to both personal and enterprise Office 365 Outlook mailboxes. To ensure the email service continues functioning, I decided to integrate Azure Communication Services. In this blog post, I will explain how I implemented support for Azure Communication Services in the Moonglade.Email Azure Function.
Sometimes, it's crucial to know the underlying operating system running your Azure App Service. This can help you address compatibility issues during development before deploying to Azure. Unfortunately, Microsoft's documentation does not specify the exact operating system name and version of the Web Worker that runs your application. So, it's up to us to determine this information.
In my previous blog post, "How to List All Files in a Public Azure Storage Container", I demonstrated how to use the Azure REST API to retrieve a comprehensive list of all file information in a public Azure Storage container without requiring any keys or authentication. Leveraging this method, you can easily create scripts to download all files from a public Azure Storage container without the need to install any additional tools. In this post, I will share PowerShell and Python scripts to do that.
Typically, we use the Azure SDK to upload files to Azure Blob Storage, as it is the easiest method supported by Microsoft. However, there are situations where the Azure SDK might not be available. So, how can we still upload files to Azure Blob Storage in such cases? In this post, I will guide you through the steps to upload files to your Azure Storage Account without using the Azure SDK.
I discovered a website that serves its files from an Azure Storage blob container. I'm curious about the contents of this directory. However, Azure Storage Accounts, when used as web servers, do not support "directory browsing." Is it still possible to list all the files in the directory? Let's see. To list all the files in a public Azure Storage Blob container, we can use send HTTP requests to the Azure Storage REST API, or use Azure CLI and Azure SDK. Let's begin with the most easy way.